if function shows 0 instead of blank

W

Wanna Learn

Hello this is my formula =IF(F38=" "," ",IF(F38="YES",C25,FALSE)) I do
not get the result I want. If F 38 is blank it shows a 0 .I do not want the
zero I want it to be blank thanks
 
K

Kevin B

You don't need a nested if statement for this, try the following:

=IF(F38="YES",C25,"")
 
D

Dave Curtis

Hi,
it depends on what you are trying to achieve.

Try =IF(F38<>"","",IF(F38="YES",C25,""))

or maybe

=IF(AND(F38="",F38="YES")C25,"")

Dave
 
B

Bob Phillips

Dave,

You might care to explain how F38 can be both "" and "YES" (2nd example, the
one with the missing comma) <bg>
 
M

MyVeryOwnSelf

Hello this is my formula =IF(F38=" "," ",IF(F38="YES",C25,FALSE))
I do not get the result I want. If F 38 is blank it shows a 0 .I
do not want the zero I want it to be blank thanks

Though it looks the same, a cell with a "space" character in it is
different from a cell that's empty. Your formula is testing for one
"space" character only.

Also, if C25 is empty, the formula returns returns zero in the "YES" case.

To allow for unseen spaces in general, and to allow for C25="", you might
consider something like:
=IF(TRIM(F38)="","",IF(TRIM(F38)="YES",IF(TRIM(C25)="","",C25),FALSE))

The TRIM function is described in Excel's built-in Help.
 

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

Top