• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Matching Column

geo Jul

New Member
Dear All​
I want to check if the first 8 consecutive cells in column B match the first 8 consecutive cells in any of the columns D through W. If a match is found, we return the column number; otherwise, return "No Match".​
Any assistance would be greatly appreciated​
Regards​
George​
 

Attachments

  • Book1.xlsx
    36.2 KB · Views: 4
try:
Code:
=LET(First8,B2:B9,range,D2:W9,TEXTJOIN(", ",TRUE,FILTER(TEXTBEFORE(ADDRESS(1,COLUMN(range),4),"1"),BYCOL(range,LAMBDA(a,SUM(--(First8=a))))=8,"No match")))
If there are multiple matces it will return all of them.

It could be tweaked a bit to deal with more than just 8 rows by changing the =8 in the formula to =ROWS(First8)
You could make this formula into a named lambda formula in Name Manager.
Create a new Name and make its definition:
Code:
=LAMBDA(First8,range,TEXTJOIN(", ",TRUE,FILTER(TEXTBEFORE(ADDRESS(1,COLUMN(range),4),"1"),BYCOL(range,LAMBDA(a,SUM(--(First8=a))))=ROWS(First8),"No match")))

1722863566315.png

then on the spreadsheet, use it like this:
1722863308351.png

See cell AA7 and AA8 in the attached.
 

Attachments

  • Chandoo57492Book1.xlsx
    36.6 KB · Views: 7
Last edited:
try:
Code:
=LET(First8,B2:B9,range,D2:W9,TEXTJOIN(", ",TRUE,FILTER(TEXTBEFORE(ADDRESS(1,COLUMN(range),4),"1"),BYCOL(range,LAMBDA(a,SUM(--(First8=a))))=8,"No match")))
If there are multiple matces it will return all of them.

It could be tweaked a bit to deal with more than just 8 rows by changing the =8 in the formula to =ROWS(First8)
You could make this formula into a named lambda formula in Name Manager.
Create a new Name and make its definition:
Code:
=LAMBDA(First8,range,TEXTJOIN(", ",TRUE,FILTER(TEXTBEFORE(ADDRESS(1,COLUMN(range),4),"1"),BYCOL(range,LAMBDA(a,SUM(--(First8=a))))=ROWS(First8),"No match")))

View attachment 87785

then on the spreadsheet, use it like this:
View attachment 87784

See cell AA7 and AA8 in the attached.
if I want more columns, how can I amend your genius formula
I am thankful for the support you have given and Your assistance has had a significant impact many thanks
 
Last edited:
Back
Top