Home » excel » excel – Find if any value from a range is in an array

excel – Find if any value from a range is in an array

Posted by: admin April 23, 2020 Leave a comment

Questions:

I want a formula that will look at a (one-wide) array of cells, and return TRUE if any of those cells take a value between 22 and 30, and FALSE otherwise. Is there an elegant way to do this, or should I just search for every value individually, and shove them inside an OR?

The only way I can think of to do it is

=NOT(AND(ISNA(VLOOKUP(22,ArrayAddress,1)),ISNA(VLOOKUP(23,ArrayAddress,1)),ISNA(VLOOKUP(24,ArrayAddress,1))...))
How to&Answers:

try to use following formula:

=SUMPRODUCT((ArrayAddress>=22)*(ArrayAddress<=30))>0

or

=COUNTIFS(ArrayAddress,">=22",ArrayAddress,"<=30")>0