If Or Or Or Statement Then

elsaidmi

New Member
Joined
Mar 19, 2015
Messages
29
Good afternoon,

I need to write a formula that does the following:

If cell is (#### or #### or any letter combination) then put "MA"
if cell is (#### or ####) then put "SC"

#### stand for a combination of a few numbers.

Haven't been able to figure it out. Thank you!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Is #### letters or numbers?
You say "(#### or #### or any letter combination)" then "#### stand for a combination of a few numbers"
 
Upvote 0
Base something on this

=IF(OR(A1="abc",A1="def",A1="ghi"),"MA",IF(OR(A1="jkl",A1="mno"),"SC","Neither"))

Change the values as necessary.

You'll need to be specific on what "a combinationo of a few numbers" is.
 
Upvote 0
Base something on this

=IF(OR(A1="abc",A1="def",A1="ghi"),"MA",IF(OR(A1="jkl",A1="mno"),"SC","Neither"))

Change the values as necessary.

You'll need to be specific on what "a combinationo of a few numbers" is.

Thank you - #### stands for a combination of numbers
 
Upvote 0
So as Special-K99 says,
=if(or(A1=1234,A1=2345),"MA",if(or(A1=4567,A1=5678),"SC","")
 
Upvote 0
Bear in mind that if you are checking for numbers, you don't need the inverted commas.

Using Special-K99's formula layout, say if you want everything that has 1111, 2222 or any letter combination to be MA, and 3333 or 4444 to be SC:

=IF(OR(A1=1111, A1=2222, ISTEXT(A1)), "MA", IF(OR(A1=3333, A1=4444), "SC", "Neither"))
 
Upvote 0
Bear in mind that if you are checking for numbers, you don't need the inverted commas.

Using Special-K99's formula layout, say if you want everything that has 1111, 2222 or any letter combination to be MA, and 3333 or 4444 to be SC:

=IF(OR(A1=1111, A1=2222, ISTEXT(A1)), "MA", IF(OR(A1=3333, A1=4444), "SC", "Neither"))


Perfect!! Do you know another way I can do this data? Here are more details...

I have a list of numbers = MA , a list of numbers = SC, but I also have a list of letter combinations that can change that would also equal MA.


instead of listing the choices 1111,2222,3333,4444, is it possible to have it search through a compiled list for each one? And then also keep the test for istext instead of listing out the letter combinations because those change often...

Thank you very much for your help!
 
Upvote 0
If you have a list on a separate sheet, the usual way I would check is something like:

=IF(OR(NOT(ISERROR(MATCH(A1, yourlist, 0))), ISTEXT(A1)), "MA", ... )

Where yourlist is a range of numbers against which you wish to check.
 
Upvote 0
If you have a list on a separate sheet, the usual way I would check is something like:

=IF(OR(NOT(ISERROR(MATCH(A1, yourlist, 0))), ISTEXT(A1)), "MA", ... )

Where yourlist is a range of numbers against which you wish to check.


It isn't finding the correct values, here is the first part...
It isn't differentiating between the two, it is finding only "OTHERS" althrough there should be some "M"s

=IF(OR(NOT(ISERROR(MATCH(D19,'OC Helper'!$H$3:$I$20,0)))),"M","OTHER")
 
Upvote 0
If you have a list on a separate sheet, the usual way I would check is something like:

=IF(OR(NOT(ISERROR(MATCH(A1, yourlist, 0))), ISTEXT(A1)), "MA", ... )

Where yourlist is a range of numbers against which you wish to check.

never mind - data consistency error!! figured it out! thanks for the help!
 
Upvote 0

Forum statistics

Threads
1,217,265
Messages
6,135,540
Members
449,946
Latest member
Axdby

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