IF STATEMENT PROBLEM

M

Manjit Gosal

Hi Guys

I am quite new to IF Statements, but I have been thrown into a deep end. I
want three different values in cells in a column. My problem is that I can
get true or false values but I can't leave the cell blank if there is no
data in cells A1 and B1. The function that I want is that if cells A1 and B1
have values then D1=Sum(A1:B1) and Cell C1 then dispalys either Y, P or N,
which I want and got it right. If there are no values in Cells A1 and B1
then I am getting Y or False in Cell C1 but I want it to be left blank. The
statement looks something like this:

=IF(D1>=(A1+B1),"Y",IF(D1<1,"N",IF(D1<(A1+B1),"P")))


Please Help!!!!
 
G

Guest

Your problem is that D1>=(A1+B1) treats A1 and B1 as 0 if there is no value
in them. If A1 and B1 is blank, then you will get Y (or true) for any
postive value in D1. I think you need another if statement. like this.

=IF(A1+B1=0,"",IF(D1>=(A1+B1),"Y",IF(D1<1,"N",IF(D1<(A1+B1),"P")))
 
M

Manjit Gosal

Thanks a lot to both of you. You both were right but didn't get blank cell
still, but by mixing the two statements i.e. putting bits from both your
statements I eventually got it right. This is how it looks now:

=IF(A1+B1=0,"",IF(D1>=(A1+B1),"Y",IF(D1<1,"N","P")))

Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top