Home > other >  How to return a blank field to a cell when a formula is working a number
How to return a blank field to a cell when a formula is working a number

Time:10-05

Probably a really easy solution.

I'm working with a sheet that has a simple division of two numbers to return the difference as a percentage. In this case: =O12/K12

Now if O12 and K12 are empty the cell returns a value of 0.00%. How can I change the formula so it just stays blank if there is no data in O12 and K12 please?

Any help would be amazing!

Thanks Ryan

CodePudding user response:

This happens because the empty string in a math formula is parsed to zero. To avoid this, you could check if both are numbers before:

=IF(AND(ISNUMBER(O12),ISNUMBER(K12)),O12/K12,)

What it means: if O12 and K12 are numbers, calculate the division. If not, return an empty string (blank).

CodePudding user response:

try:

=IFERROR(1/(1/(O12/K12)))
  • Related