Ryan Williams
Ryan Williams

Reputation: 13

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

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

Upvotes: 1

Views: 138

Answers (2)

Rodrigo Nóbrega
Rodrigo Nóbrega

Reputation: 86

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).

Upvotes: 1

player0
player0

Reputation: 1

try:

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

Upvotes: 0

Related Questions