# IF Then - Mulitple Conditions

#### LMaeExcel

##### New Member
Hello! I am hoping for some help with an If Then formula or possibly another formula that will accomplish the below:

I'd like the formula to check for multiple conditions, such as:
If B2 = "MI" then say "MI2" in this cell, or if B2 = "NY" then say "NY2" in this (same) cell, or I B2 = "FL" then say "FL2" in this (same) cell... and so on

Help is appreciated!

### Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

#### Roderick_E

##### Well-known Member
Maybe something like:
Code:
``=IF(b2={"MI","NY","FL"},{"MI2","NY2","FL2"})``

#### LMaeExcel

##### New Member
I'm still experimenting, but I think I'm onto something. =if(A1="NY","NY2",if(A1="AZ","AZ2",if(A1="MI","MI2"," "))) Seems to be working so far, but I'll try yours out too and see if that also works.

#### jimrward

##### Well-known Member
Are you always adding 2 to the end of 2 character strings

If so, try, =IF(LEN(A1)=2,A1&"2",A1)

#### LMaeExcel

##### New Member
jimrward, that did it! Thank you! The formulas above were working, but as I continued to include 50+ scenarios, it stopped working when it reached a certain length.
Simple and worked awesome!

#### T. Valko

##### Well-known Member
Are you always adding 2 to the end of 2 character strings

If so, try, =IF(LEN(A1)=2,A1&"2",A1)
You don't need to use quotes around the number 2.

=IF(LEN(A1)=2,A1&2,A1)

The only time you'd need to quote numbers is if it's a string of numbers starting with a leading 0.

=IF(LEN(A1)=2,A1&"012",A1)

Replies
3
Views
625
Replies
5
Views
538
Replies
7
Views
619
Replies
1
Views
269
Replies
4
Views
304

1,191,003
Messages
5,984,109
Members
439,872
Latest member
noaman79

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