OR formula using array in the logic

scott_86_

New Member
Joined
Sep 27, 2018
Messages
40
Office Version
  1. 365
Platform
  1. Windows
Hi,

(Using Microsoft 365)

I'm sure I've been able to achieve this in the past; however, I'm struggling to do it again: Is it possible to use an array for 'logical1' in the OR (or another) formula?

I thought =OR(A2=$C$2:$C$8) would work and then copy the formula down; however, unfortunately it does not.

Example just using row 2 below: If A2 = any item in C2:C8 then it will be TRUE.

Thanks.

1711184175798.png
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
You could do something like this

Excel Formula:
  =IF(ISERROR(MATCH(A1,$C$2:$C$8,0)),"","True")
 
Upvote 0
my match formula post#2 should have said A2 instead of A1

if you need an exact match, eg: case sensitive
the match formula i provided does not allow for case sensitivity.

if you require case sensitive match, this one does the trick

Excel Formula:
  =IF(ISERROR(MATCH(TRUE,EXACT($C$2:$C$8,A2),0)),"not in list","in list")

Note:

When you enter this formula, hold the CTRL + SHIFT key then press ENTER

then you can copy the formula down
 
Upvote 0
Note:

When you enter this formula, hold the CTRL + SHIFT key then press ENTER
FYI: The OP has Microsoft 365 so Ctrl+Shift+Enter is not required.

I thought =OR(A2=$C$2:$C$8) would work
As I understand your requirement, it does work. Isn't this what you are describing?

BTW, I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.

24 03 23.xlsm
ABC
1
2Breating ApparatusTRUEBreating Apparatus
3Confined SpaceTRUEConfined Space
4OtherFALSEFirst Aid
5First AidTRUE
OR
Cell Formulas
RangeFormula
B2:B5B2=OR(A2=C$2:C$4)
 
Upvote 0
Peter_SSs, thanks for the tip about Microsoft 365, I'm running Office 2019
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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