# Joining And with Or in an If Statement

#### Excel_77

##### Active Member
Hi All,

The below code was working perfectly, however I want to add an extension to the formula to check that the football column = "yes" and the sport column = either "1" or "2" then I want "no" returned, otherwise go on to the next aspect of the formula.

=IF(Football_Column="Yes","12 Months"AND(Sport_Column="1"OR("2"),"No"),IF(Television_Column="Yes","Secure",IF(Rest_Column="Test","Check","Correct")))

How can I fix this?

Last edited:

### Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

#### Scott Huish

##### MrExcel MVP
=IF(Football_Column="Yes",IF(OR(Sport_Column={1,2}),"No","12 Months"),IF(Television_Column="Yes","Secure",IF(Rest_Column="Test","Check","Correct")))

#### Excel_77

##### Active Member
=IF(Football_Column="Yes",IF(OR(Sport_Column={1,2}),"No","12 Months"),IF(Television_Column="Yes","Secure",IF(Rest_Column="Test","Check","Correct")))
Thanks but I think I made a mistake with my original code, is should have been as follows, can this still be done?

=IF(Football_Column="Yes",AND(Sport_Column="1(6)"OR("2(9)"),"No"),IF(Television_Column="Yes","Secure",IF(Rest_Column="Test","Check","Correct")))

Last edited:

#### Scott Huish

##### MrExcel MVP
=IF(Football_Column="Yes",IF(OR(Sport_Column={"1(6)","2(9)"}),"No","12 Months"),IF(Television_Column="Yes","Secure",IF(Rest_Column="Test","Check","Correct")))