Combing IF statements

DctheDC

New Member
Joined
Jun 7, 2016
Messages
37
I am trying to return a value based on a cells contents but also based on certain conditions and I cannot work out how to run two IF statements in a single formula


If Cell A1 contains "Cat" return a value of "Y" else leave blank, this I can do with =if(A1="Cat","Y","")


but I need to append an additional IF formula so if Cell A1 Contains "Dog" and Cell A2 equals "Y" then return a value of "N" else leave blank

Cheers
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi, you can nest the second if() for example:

=IF(A1="Cat","Y",IF(A1="Dog","N",""))
 
Upvote 0
Actually I think FormR missed part of your request, try this:

Code:
=IF(A1="Cat","Y",IF(And(A1="Dog",A2="Y"),"N",""))
 
Upvote 0
Thanks FormR

It works as per your formula but it does not include the fact I need Cell A2 to have a "Y" in it to run the Dog part of the formula to return 'N' as the value

Cheers
 
Upvote 0
"Crossed in the post" as they say

Yes I did see it and it worked perfectly thanks Philwojo
 
Upvote 0

Forum statistics

Threads
1,216,587
Messages
6,131,586
Members
449,657
Latest member
Timber5

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