IF, AND but no idea!

Scruffy77

New Member
Joined
Feb 26, 2004
Messages
29
Hello,
I'm new to AND statements and was wondering if someone could help me.
I'm trying to make a formula (I believe an IF/AND statement will do) that will look at 2 columns and if both values are equal to what I specify, then it returns a value I specify into another column. If either of the values are not equal to the value I specify, it returns a blank

i.e
if Column A is equal to "X", and column B is equal to "Y", then return "004" in Column C,
and if either Column A OR B is not equal to the values I set out (A= X and B = Y) then return blank

(Note: If Column A is = to X, but Column B is not equal to "Y", it returns blank or vice versa)

Perhaps I'm making this more complicated, but I'm trying to work it out and it's not working! :)

If anyone has any ideas please let me know.
Thanks in advance
 

iggydarsa

Well-known Member
Joined
Jun 28, 2005
Messages
1,647
=IF(AND(A1="X", B1="Y"), "004", "")

Edit: Sorry didn't see the previous post
 

Scruffy77

New Member
Joined
Feb 26, 2004
Messages
29
Thank you

Thank you! It works perfectly!
I reason I was having trouble with it was that the second value was a number and I was putting quotes around it..

Thanks again!
 

Forum statistics

Threads
1,078,005
Messages
5,337,689
Members
399,160
Latest member
Vantone

Some videos you may like

This Week's Hot Topics

Top