excel question

Joined
Oct 12, 2007
Messages
4
Reaction score
0
Hi,
I hope this is the correct forum..

I want to set the value in a cell depending on the relative values of 2 other cells.

if cell A < cell B --> cell C = 0
if cell A > cell B --> cell C = 2
if cell A = cell B --> cell C = 1

I can't work out the syntax despite lots of trying.

This is excel 2003 sp2 running on w2k sp4

anyone any ideas?

cheers
 
Try something like =IF(A1 < B1, "0", "(IF(A1 > B1, "2", "1"))")

Put that into the C1 cell and it might do it. :) It's just one conditional within the other to check for < then, > then or = to (if it is none of the above).
 
Hi - thanks for the suggestion

I can see the logic of what you have suggested but it doen't want to know - this is what has been frustrating me.

Do I need an OR in there somewhere?

cheers
 
Try this formula..just swap the "wording" with your own

=IF(A1<B1,"Less",IF(A1=B1,"Equal","More"))
 
Back
Top