Excel Help - the If function

Aussie Pythons & Snakes Forum

Help Support Aussie Pythons & Snakes Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Status
Not open for further replies.

slim6y

Almost Legendary
Joined
Aug 20, 2006
Messages
8,285
Reaction score
10
Location
New Zealand
Hey...

I've worked out to use the If function - but it is counting blank cells which I don't want...

I'm using it to work out if one number is greater than the other or the same - but NOT if it is blank.

Eg...

Column A might be 1 and Column B might be 2;

I've used the If column A is > Column B then = 1
Then I've used in the next column If Column A is < Column B then = 1
Then in the next column I've got If Column A = Column B then = 1

Now the main problem is the columns are currently all blank so the first two formulas throw a false reading and come up with 0 correctly.

But because both are blank, both are throwing a 1 in the third column which I can't use.

I need it to read something like:

If Column A = Column B then = 1 but if Column A = Blank and Column B = Blank then = 0

How do I do that?

Current formula looks like:
=IF(C2=E2,1,0)

How do I put the blanks in?
 
try a nestered if

=IF(OR(B1="",A1=""),"",IF(A1=B1,1,0))

I've made it more complicated than it needs to be, but the OR just means that if either column A or column B are blank then then formula returns blank
 
try a nestered if

=IF(OR(B1="",A1=""),"",IF(A1=B1,1,0))

I've made it more complicated than it needs to be, but the OR just means that if either column A or column B are blank then then formula returns blank

By gollie by gosh.. Case CLOSED!!!

It WORKS!!

thanks mate! You're a saviour.

Not seen the 'or' before! But seems logical now!
 
There's also an AND, works the way you'd think. Excel is great, there are a lot of neat things that you can do with it. Let me know if you ever need help.
 
Status
Not open for further replies.
Back
Top