• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How do I account for empty cells?

codedreamer

New Member
I have several conditionals in a cell is something like this: =IF(AND(A1<2,B2>4),"1")
How do I get the result to be an empty cell if either A1 or A2 are blank(no data in them)?
I tried isblank, but did not worked for me, I also tried saying A1="", but it did not work either, neither <> worked. Any help is appreciated.

Thanks.
 
The condition gets a bit simpler if you can treat both zero and blanks as invalid. The shortest formula is one that would give TRUE for conditions that match your criteria and FALSE for those that do not.
= IF( A1*B2, AND(A1<2,B2>4), "" )

If you really want the text character "1" for true and FALSE when the condition is not satisfied you would need to put the logical expression within an IF function
= IF( A1*B2, IF(AND(A1<2,B2>4),"1",FALSE), "" )
but it is an odd requirement.
 
Back
Top