Checking values from a range in a particular cell

Mark McInerney

Active Member
Joined
Apr 4, 2012
Messages
262
Office Version
  1. 365
Platform
  1. Windows
Hi Folks - Thanks for taking a look at this.

I have a few ranges of data:

1676539545458.png


There are many more ranges, Range 1 thru Range 20. As per the above, Range 1 and 2 and so on, have a listing of data entries e.g. Range 1 has Keary, Murphy, Kelly, Malluisk, Kernan and littleton - names will be added and removed from time to time.

The listing column needs to be able to determine if any word in it's listing, appears in any of the cells across all the ranges.

The logic for Cell F3 needs to check of any of the entries in Range 1 are in Cell E3, or, in Range 2 are in E3 and tag it accordingly. There can be anything up to 20 ranges.

Any help appreciated - Thanks - Mark.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Try in Cell F3

=IF(SUMPRODUCT(COUNTIF(INDIRECT("Range 1"), "*"&E3&"*"))>0, "Range 1", IF(SUMPRODUCT(COUNTIF(INDIRECT("Range 2"), "*"&E3&"*"))>0, "Range 2", ""))
 
Upvote 0
Could any of the words in the Listings col appear in more than one of the ranges? If so what should the output be?
 
Upvote 0
Hi Fluff,

Hope all good with you - no - the values will be unique - they will only appear in one of the ranges.

Thanks for taking a look Anbuselvam - will try ot out today and let you know.
 
Upvote 0
So with your example you couldn't have Keary in Range1 & John in Range3
 
Upvote 0
Ok (y)
Another option
Fluff.xlsm
ABCDEFGH
1
2Range 1Range 2Range 3Range 4
3afioa zRange 1
4bgjpx hRange 2
5chkqnRange 3
6dlrc yRange 1
7em
8n
9
Main
Cell Formulas
RangeFormula
H3:H6H3=LET(h,HSTACK(TOCOL(B3:E9,1),TOCOL(IF(B3:E9="",x,B2:E2),2)),BYROW(G3:G6,LAMBDA(br,CONCAT(IFNA(VLOOKUP(TEXTSPLIT(br," ",,1),h,2,0),"")))))
Dynamic array formulas.
 
Upvote 0
Hi Fluff,

It is working fine (some formula!)- is there a way to tweak it to allow for two words to be checked.

In the dataset above if Cell B3 is not "A" but rather "A Z", Cell H3 is not populating, when I need it to?

Thanks - Mark.
 
Upvote 0
How about
Excel Formula:
=LET(h,HSTACK(TOCOL(B3:E9,1),TOCOL(IF(B3:E9="",x,B2:E2),2)),BYROW(G3:G6,LAMBDA(br,IFNA(VLOOKUP(br,h,2,0),CONCAT(IFNA(VLOOKUP(TEXTSPLIT(br," ",,1),h,2,0),""))))))
 
Upvote 0

Forum statistics

Threads
1,215,039
Messages
6,122,802
Members
449,095
Latest member
m_smith_solihull

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