# multiple variables in an IF statement

#### R0ckie

##### New Member
Trying to use IF in a spreadsheet formula to return a value based on 2 other values being met. Trouble is, the 2 values that have to be satisfied can be different. I.E., Value 1 can be constant and Value 2 could have multiple values. An additional Value 1 could have different multiple values. My formula (as follows) works thru the first set but then returns FALSE.

=(IF(A2="ftow",IF(B2="MOB2012","FTOW",IF(A2="Ftow",IF(B2="MOB2013","ftow",IF(A2="Ften",IF(B2="DAS ENET","FIBR",IF(A2="Ften",IF(B2="COW SPL EVT","FIBR",0)))))))))

 Value 1 Value 2 Desired Return Returned value FTOW MOB2013 FTOW ftow FTOW MOB2012 FTOW FTOW FTEN DAS ENET FIBR FALSE FTEN COW SPL EVT FIBR FALSE

<COLGROUP> <COL style="WIDTH: 40pt; mso-width-source: userset; mso-width-alt: 1938" width=53><COL style="WIDTH: 66pt; mso-width-source: userset; mso-width-alt: 3218" width=88><COL style="WIDTH: 76pt; mso-width-source: userset; mso-width-alt: 3693" width=101><COL style="WIDTH: 57pt; mso-width-source: userset; mso-width-alt: 2779" width=76> <TBODY>
</TBODY>

<COLGROUP><COL style="WIDTH: 40pt; mso-width-source: userset; mso-width-alt: 1938" width=53><COL style="WIDTH: 66pt; mso-width-source: userset; mso-width-alt: 3218" width=88><COL style="WIDTH: 76pt; mso-width-source: userset; mso-width-alt: 3693" width=101><COL style="WIDTH: 57pt; mso-width-source: userset; mso-width-alt: 2779" width=76><TBODY>
</TBODY>

### Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

#### MMortal

##### New Member
Would something like this help:
=IF(AND(A2="FTOW", B2="MOB2013"),"True", "False")

#### jai9

##### Active Member
Hi,

Try,

=IF(AND(A2="FTOW",OR(B2="MOB2013",B2="MOB2012")),"FTOW",IF(AND(A2="FTEN",OR(B2="DAS ENET",B2="COW SPL EVT")),"FIBR"))

Jai

#### R0ckie

##### New Member
Hi, Jai,

It works - I figured it needed an OR somewhere.

Thanks,
R0ckie

Replies
3
Views
711
Replies
1
Views
663
Replies
7
Views
4K
Replies
1
Views
1K
Replies
7
Views
765

1,195,594
Messages
6,010,627
Members
441,558
Latest member
lambierules

### 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.

### Which adblocker are you using?

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

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