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
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
=IF(AND(A1="X", B1="Y"), "004", "")

Edit: Sorry didn't see the previous post
 
Upvote 0
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!
 
Upvote 0

Forum statistics

Threads
1,213,482
Messages
6,113,915
Members
448,532
Latest member
9Kimo3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top