Home » excel » Differentiate between Zero, blank and a number in excel

Differentiate between Zero, blank and a number in excel

Posted by: admin May 14, 2020 Leave a comment


I have two excel sheets in a document used to export data to another program. One sheet is the input data for the experimental data which can ether be a 0 to 9 or a blank.

The second sheet grabs the data from the input sheet and rearranges it in the correct formatting for the analytic program to run. In order for the information to show up correctly since blanks are still a data point for us ive used the formula

=IF(ISBLANK(C2),"",IF(C2=0, "0")

This formula allows it to differentiate the difference between a blank and a 0.

However if I try to build onto that formula by adding IF(C2=1,"1") to show the first sheets number i get an error for too many arguments in the function.

Is there a way to get it to display the value of the cell if the cell is neither a blank or zero?

How to&Answers:

The simplest way you can get the formula to return the value if the cell is not blank, and a blank cell if the cell is blank would be:


This will return:

Input | Output
    1 |      1
    2 |      2
    0 |      0
    9 |      9


So to return a value and nothing if the cell is blank OR 0 then this will work:

enter image description here

The OR() function checks for the blank or the 0 and the IF() uses that result to give a blank or the cell value.