# Need help Coding my cells correctly-3 comparisons to be made

G

#### Guest

Greetings,
I only want to utilize four cells for this operation (in a single line in
this case line 4), I will want to use it throughout the worksheet but I'm
trying not to sprawl into any more cell usage.
Hers's the idea...to get these four cells to accomodate the following, I
keep having problems with my second condition being met and the cells staying
blank until some data is entered. It's not neccessary but it would be helpful
if the cells appear blank until some data has been actually entered and not
like its trying to compute the blank cells.

First a comparsion would be made

If C4 = D4 then cell E4 displays "Equal" and cell F4 displays "Amount"

If this condition does not occur then 2 more comparisons will occur...

If C4 < D4 then D4-C4 and the result goes into cell E4 and cell F4 is blank

Else, C4 > D4 then C4-D4 and result goes into cell F4 and cell E4 is blank

Thanks

R

#### Ragdyer

Enter this in E4:
=IF(C4=D4,"Equal",IF(C4<D4,D4-C4,""))

Enter this in F4:
=IF(C4=D4,"Amount",IF(C4>D4,C4-D4,""))

G

#### Guest

One way ..

In E4:
=IF(COUNTBLANK(C44)=2,"",IF(C4<D4,D4-C4,IF(C4=D4,"Equal","")))

In F4:
=IF(COUNTBLANK(C44)=2,"",IF(C4>D4,C4-D4,IF(C4=D4,"Amount","")))

Select E4:F4, copy down