Command to make a forumula fron not running

B

boxterduke

Hello there,

Is there an excel command to skip a formula from being used if there is no
information in the cell?

See below for example.

F G H
I J
---------------------------------------------------------------------
166 $5.85 92,870.00 $542,868 67,340 $393,633
---------------------------------------------------------------------
167 $6.14 $0 14,700 $90,225

In row 166 the formula for cell H166 is =(IF(G166>0,(G166*F166)))

For row 167, since cell G167 is blank, I want the formula to be skipped
since I don't want cell H167 to show $0

The way I have it now is =(IF(G167>0,(G167*F167),0)) but I don't want $0 to
be shown and instead of just clearing the cell I would like an automated way
to prevent the formula from running.

Thank you
 
J

John C

This could be your formula in H166:
=IF((G166*F166),G166*F166,"")
Essentially, if G166 x F166 is anything other than 0, it will populate the
cell, otherwise, it will leave it blank.
 
T

THendr2929

I am not sure if there is a way to prevent a formula from running once since
it has to evaluate the formula to determine the results, but the easiest way
is to change the FALSEPART of your IF function as follows:
=(IF(G167>0,(G167*F167),""))

If the formula evaluates to false, then Excel will display an empty cell
instead of "$0".
 
Top