Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IF statements referring to blank cells

Status
Not open for further replies.

stoke

IS-IT--Management
Apr 15, 2003
50
AU
hi,
i have the folowing formula:
=IF(E6>C6,&quot;3&quot;,IF(E6=C6,&quot;1&quot;,IF(E6<C6,&quot;0&quot;)))
that returns a value even if there is no data in the cell.

I only want the formula to return a value when the cell has data in it.

can anybody help me please?
Thank you.
 
Is there a reason for using in your formula &quot;3&quot;,&quot;1&quot;,&quot;0&quot;
instead of using 3,1,0?
Do you want to test text or numbers?
 
you need to test for a blank cell 1st:
=IF(OR(E6=&quot;&quot;,C6=&quot;&quot;),&quot;&quot;,IF(E6>C6,&quot;3&quot;,IF(E6=C6,&quot;1&quot;,IF(E6<C6,&quot;0&quot;))))
this will give a 0 length string if either E6 or C6 have no value in them


Rgds
Geoff
&quot;Some cause happiness wherever they go; others whenever they go.&quot;
-Oscar Wilde
 
try something like
=IF(OR(ISBLANK(E6),ISBLANK(C6),&quot;&quot;,IF(E6>C6,&quot;3&quot;,IF(E6=C6,&quot;1&quot;,IF(E6<C6,&quot;0&quot;))))

and check-out
ISNUMBER() ISERROR() etc
 
xlbo
jammed in the doorway!!
age before beauty (and pearls before swine)
 
Ahm the fastest poster in the west - yesirree ;-)

Rgds
Geoff
&quot;Some cause happiness wherever they go; others whenever they go.&quot;
-Oscar Wilde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top