Forum

Notifications
Clear all

If then statement

3 Posts
3 Users
0 Reactions
89 Views
(@cgray)
Posts: 16
Eminent Member
Topic starter
 

Hello,

Can you please let me know what the formula is to have the result be "White & Yellow" if the White and Yellow columns are True, "White" if the White column is TRUE and the Yellow column is FALSE, "Yellow" if the White column is FALSE and the Yellow column is TRUE, and the "Neither" if both the White & Yellow columns are "FALSE"?

 

Thanks,

 
Posted : 13/02/2020 12:19 pm
(@purfleet)
Posts: 412
Reputable Member
 

Probably a couple of ways to do it and some will depend on what version of excel you have.

The way that should work in all version is the nested ifs with and's

=IF(AND(A2=TRUE,B2=TRUE),"White & yellow", IF(A2=TRUE,"White",IF(B2=TRUE,"Yellow", IF(AND(A2=FALSE,B2=FALSE),"Neither"))))

You don’t really need the last if(and) as it you can have it as a default, but I tend you use the last default as an error checker if there is only a small number of options - i.e. if I have done something wrong the formula will say FALSE

Purfleet

 
Posted : 13/02/2020 3:45 pm
Anders Sehlstedt
(@sehlsan)
Posts: 968
Prominent Member
 

Hello,

In case you have Excel 2016 or newer you can use IFS function.
https://www.myonlinetraininghub.com/excel-ifs-function

 
Posted : 13/02/2020 6:08 pm
Share: