If statment involving a list

SammiBoi

Board Regular
Joined
Jun 1, 2007
Messages
77
hello

I want to make a excel IF statement that check against a range of variable specifically if the last 2 letters of a cell equals to either NE, NW or SE, but I am not sure if there's a way to program this in 1 IF statement rather than 3.

I started with something like this but it didn't work

=if(right(A1,2)=OR("NE","NW","SE"),"area in list","area not in list")

Any idea would be greatly appreciated!
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

jim may

Well-known Member
Joined
Jul 4, 2004
Messages
7,484
Maybe....

=IF(OR(RIGHT(A1,2) = "NE",RIGHT(A1,2)="NW",RIGHT(A1,2) = "SE"),"area in list","area not in list")
 
Upvote 0

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
59,294
Office Version
  1. 365
Platform
  1. Windows
An alternative that would allow for a more extended list if needed:

=IF(ISNUMBER(MATCH(RIGHT(A1,2),{"NE","NW","SE"},0)),"area in list","area not in list")
 
Upvote 0

Forum statistics

Threads
1,190,693
Messages
5,982,324
Members
439,773
Latest member
tyruschen

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
Top