excelexcel-formula

How to make Excel "IF" formula calculate blank cells as "0"?


How do I make the IF function consider blank cells as "0".

Here is the formula I am using in the H column cells: IF(E1>F1,"YES","NO")

Here is the specific Example:

E F G H
10 0 30 YES
10 5 10 YES
10 ------- ------- NO

H3 should return "YES" I would think.

In this scenario I cannot change the blank cells to "0", they have to remain blank.
From comment: It had some mistakes in it which I've fixed. In Column F I have a vlookup from another sheet. The cell in the other sheet is actually blank with nothing in it.
What would be the correct formula for me to use?

I have tried searching around on google and stackoverflow, but the only things I can find are where people are trying to NOT have blanks be considered "0".


Solution

  • =IF(ISBLANK(F1),"YES",IF(E1>F1,"YES","NO")) - Will check for a blank cell, this will work if column F is not formulated

    =IF(F1="","YES",IF(E1>F1,"YES","NO")) - Performs a similar check but for the set value "" which is a formulated forced blank cell

    =IF(ISNUMBER(F1),IF(E1>F1,"YES","NO"),"YES") - Sense check for if the cell is a number (In case the formulated column is a numerical calculation)