Long OR list, a better way?

jkicker

Board Regular
Joined
Jun 7, 2018
Messages
79
Hi all,

I want to check if my cell is equal to one of many things. At the moment I have:

=OR(I2="Tenured Faculty",I2="Continuing Teaching Stream",I2="All other Librarians",I2="Contract-Limited",I2="Term Assignment",I2="Limited-Term Lecturers")

Is there a better way to write this out (in cell and without VBA)?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I'd put the list of valid entries into a range and then compare the cell to that range using something like COUNTIF or MATCH, or even an array-entered OR formula.
 
Last edited:
Upvote 0
Array-entered OR formula would be something like:

=OR(I2=B1:B6)
?

I'm nesting the OR statement in an IF statement as my TRUE/FALSE argument.
 
Upvote 0
Correct. Or use something like =COUNTIF(B1:B6,I2)>0, which doesn't require array-entry.
 
Upvote 0
you say it doesn't require array entry, but to me it looks like it does because i need to fill in B1:B6. So i was shooting for something where i did not need to fill out any other cells, i'm just trying to write that I2 equaling any of the following should return a true value without having to write "I2=" all the time. i know i could use VBA for this, was just wondering if i could do it in cell.
 
Upvote 0
How about
=OR(I2={"Tenured Faculty","Continuing Teaching Stream","All other Librarians","Contract-Limited","Term Assignment","Limited-Term Lecturers"})
 
Upvote 0
That's not what array-entry means. If you use OR(I2=B1:B6) you need to press Ctrl+Shift+Enter when entering the formula, not just Enter. That is what array-entry means.
 
Upvote 0
Thank you RoryA, i will do some follow up learning on that.
And thank you Fluff, that's what I was looking for!
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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