XLookup at Merged Cells

nburaq

Board Regular
Joined
Apr 2, 2021
Messages
220
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi Gents,
Is there any solution to use vlookup or xlookup with merged cells? Here is the sample; I would like to find the correct group by entering the name in a cell. (I know merged cells always a problem for lookup functions but the file I am busy already prepared this way) Thanks in advance and good luck!
sample.xlsx
ABCD
1GroupName AgeFormula
21John20
3Alice25
4Bob30
52Sarah45
6Kim40
7Kevin30
83Tom22
9Sally18
Go
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
I couldn't think how to do it without a helper column. I'll be very interested to see someone can solve it more elegantly.

MrExcelPlayground4.xlsx
ABCD
1GroupName Agehelper column
21John201
3Alice251
4Bob301
52Sarah452
6Kim402
7Kevin302
83Tom223
9Sally183
10
11Lookup PersonGroup
12Kim2
Sheet35
Cell Formulas
RangeFormula
D2:D9D2=MAX(A$2:A2)
B12B12=XLOOKUP(A12,B2:B9,D2:D9,"",0)
 
Upvote 0
I'm not so sure how elegant this is, but no helper column:

Book1
ABCDEF
1GroupName AgeFormulaName
21John201Sally3
3Alice251Kim2
4Bob301Bob1
52Sarah452Kevin2
6Kim402
7Kevin302
83Tom223
9Sally183
10
Sheet16
Cell Formulas
RangeFormula
F2:F5F2=LOOKUP(2,1/($A$2:INDEX($A$2:$A$100,MATCH(E2,$B$2:$B$100,0))<>""),$A$2:$A$100)
D2:D9D2=LOOKUP(2,1/($A$2:$A2<>""),$A$2:$A2)
 
Upvote 0
I couldn't think how to do it without a helper column. I'll be very interested to see someone can solve it more elegantly.

MrExcelPlayground4.xlsx
ABCD
1GroupName Agehelper column
21John201
3Alice251
4Bob301
52Sarah452
6Kim402
7Kevin302
83Tom223
9Sally183
10
11Lookup PersonGroup
12Kim2
Sheet35
Cell Formulas
RangeFormula
D2:D9D2=MAX(A$2:A2)
B12B12=XLOOKUP(A12,B2:B9,D2:D9,"",0)
I had the same solution but I thought there might have been another way to do it. Thanks for the help
 
Upvote 0
I'm not so sure how elegant this is, but no helper column:

Book1
ABCDEF
1GroupName AgeFormulaName
21John201Sally3
3Alice251Kim2
4Bob301Bob1
52Sarah452Kevin2
6Kim402
7Kevin302
83Tom223
9Sally183
10
Sheet16
Cell Formulas
RangeFormula
F2:F5F2=LOOKUP(2,1/($A$2:INDEX($A$2:$A$100,MATCH(E2,$B$2:$B$100,0))<>""),$A$2:$A$100)
D2:D9D2=LOOKUP(2,1/($A$2:$A2<>""),$A$2:$A2)
Hmm things getting very interesting I love brainstorming :)
 
Upvote 0
This one is similar to @Eric W 's solution . . .

F2, copied down:

=LOOKUP(9.9999999999999E+307,$A$2:INDEX($A$2:$A$100,MATCH(E2,$B$2:$B$100,0)))

Or, if you don't like seeing that big number, first define the following name (Ribbon >> Formulas Tab >> Defined Names Group >> Define Name) . . .

VBA Code:
Name:  BigNum

Refers to:  9.99999999999999E+307

Then try...

=LOOKUP(BigNum,$A$2:INDEX($A$2:$A$100,MATCH(E2,$B$2:$B$100,0)))
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,580
Members
449,089
Latest member
Motoracer88

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