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

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Maybe....

=IF(OR(RIGHT(A1,2) = "NE",RIGHT(A1,2)="NW",RIGHT(A1,2) = "SE"),"area in list","area not in list")
 
Upvote 0
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,213,561
Messages
6,114,312
Members
448,564
Latest member
ED38

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
Back
Top