Excel Comparing 2 cells in an IF statement

  • Thread starter Thread starter mrcharms
  • Start date Start date
M

mrcharms

Hi and thank-you to all that go ahead and help me on this subject,

The problem(s) im having are,

1. An IF statement problem, im tyring to compare two seperate cell
against each other, i.e. is one a greater value than the other and i
so display "3" or if equal display "1" and if less than display "0" an
the formula i have so far works fine for that, but if i have that sam
formula for a set of 2 other seperate cells that are blank, the sam
formula makes that display "1" beacause their both blank, both th
same, im needing to get the formula to display the blank cells as "0
as well as the rest of the formula.

A B
1 3 1

formula... =IF(A1>B1,3,IF(A1=B1,"1","0"))

Display = 3

Any help would be appriciated greatly.

MrCharms
 
In case both cells are blank and you want the value 0 to be displayed, try the following formula

=IF(AND(A1="", B1 = ""),0,IF(A1>B1,3,IF(A1=B1,1,0))

Regards
Edwin Ta
(e-mail address removed)
http://www.vonixx.co

----- mrcharms > wrote: ----

Hi and thank-you to all that go ahead and help me on this subject

The problem(s) im having are,

1. An IF statement problem, im tyring to compare two seperate cell
against each other, i.e. is one a greater value than the other and i
so display "3" or if equal display "1" and if less than display "0" an
the formula i have so far works fine for that, but if i have that sam
formula for a set of 2 other seperate cells that are blank, the sam
formula makes that display "1" beacause their both blank, both th
same, im needing to get the formula to display the blank cells as "0
as well as the rest of the formula

A
1 3

formula... =IF(A1>B1,3,IF(A1=B1,"1","0")

Display =

Any help would be appriciated greatly

MrCharms
 
Sounds as though you're writing a program for football tables and scores.
Regards Dennis
 
Thank-you ever so much Edwin, you are a star!

It does seem that i was on the right track with that prob, i was usin
the same code to read a blank cell but i was trying to get it in th
formula as another embedded IF statement and not as a AND statement a
youve shown, thanks!!

And you are absolutely right on that analysis Dennis, im trying to mak
a Football league that auto updates when scores are inputted, and m
next prob will be getting the league table to update the teams an
their stats at the same time in the league as their points.

Thanks all

Dan (MrCharms
 
Back
Top