XLOOKUP lookup and return value that are not on the same row?

karweng

New Member
Joined
Aug 24, 2021
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Is it possible to use XLOOKUP lookup and return value that are not on the same row?

Table 1 is the unstructured dataset that I'm trying use to look up from Table 2.

In Table 1 colA value ="1" is the Parent, and "2" is the Child and the number of rows are dynamic. And, the parent row containing the address.

example 1 Lookup Value Table2.A3 Lookup Array Table1.colB Return Array Table1.C3 & D3

example 2 Lookup Value Table2.A4 Lookup Array Table1.colB Return Array Table1.C5 & D5
example 3 Lookup Value Table2.A5 Lookup Array Table1.colB Return Array Table1.C5 & D5

1633492196729.png
1633492227192.png
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
MrExcelPlayground4.xlsx
ABCDEFGHIJ
1
21202 first streetmelbourneABCD2202 first streetmelbourne
32ABCDJohDoeEFGG455 Washington AveSeacaucus
4155 Washington AveSeacaucusCCFF555 Washington AveSeacaucus
52EFGGSaraPrince
62CCFFDanPrince
Sheet12
Cell Formulas
RangeFormula
H2:H4H2=MATCH(G2,$B$2:$B$6,0)
I2:I4I2=XLOOKUP(1,INDIRECT("$A$2:$A$"&H2+MIN(ROW($A$2:$A$6))-1),INDIRECT("$C$2:$C$"&H2+MIN(ROW($A$2:$A$6))-1),"",0,-1)
J2:J4J2=XLOOKUP(1,INDIRECT("$A$2:$A$"&H2+MIN(ROW($A$2:$A$6))-1),INDIRECT("$D$2:$D$"&H2+MIN(ROW($A$2:$A$6))-1),"",0,-1)
 
Upvote 0
MrExcelPlayground4.xlsx
ABCDEFGHIJ
1
21202 first streetmelbourneABCD2202 first streetmelbourne
32ABCDJohDoeEFGG455 Washington AveSeacaucus
4155 Washington AveSeacaucusCCFF555 Washington AveSeacaucus
52EFGGSaraPrince
62CCFFDanPrince
Sheet12
Cell Formulas
RangeFormula
H2:H4H2=MATCH(G2,$B$2:$B$6,0)
I2:I4I2=XLOOKUP(1,INDIRECT("$A$2:$A$"&H2+MIN(ROW($A$2:$A$6))-1),INDIRECT("$C$2:$C$"&H2+MIN(ROW($A$2:$A$6))-1),"",0,-1)
J2:J4J2=XLOOKUP(1,INDIRECT("$A$2:$A$"&H2+MIN(ROW($A$2:$A$6))-1),INDIRECT("$D$2:$D$"&H2+MIN(ROW($A$2:$A$6))-1),"",0,-1)
Thanks @JamesCanale this formula is awesome.
 
Upvote 0
Another way to write the formula without using the volatile INDIRECT:

Book1
ABCDEFGHI
1
21202 first streetmelbourneABCD202 first streetmelbourne
32ABCDJohDoeEFGG55 Washington AveSeacaucus
4155 Washington AveSeacaucusCCFF55 Washington AveSeacaucus
52EFGGSaraPrince
62CCFFDanPrince
Sheet7
Cell Formulas
RangeFormula
H2:I4H2=XLOOKUP(1,$A$2:INDEX($A$2:$A$100,MATCH($G2,$B$2:$B$100,0)),C$2:INDEX(C$2:C$100,MATCH($G2,$B$2:$B$100,0)),"No match",0,-1)
 
Upvote 0
Another way to write the formula without using the volatile INDIRECT:

Book1
ABCDEFGHI
1
21202 first streetmelbourneABCD202 first streetmelbourne
32ABCDJohDoeEFGG55 Washington AveSeacaucus
4155 Washington AveSeacaucusCCFF55 Washington AveSeacaucus
52EFGGSaraPrince
62CCFFDanPrince
Sheet7
Cell Formulas
RangeFormula
H2:I4H2=XLOOKUP(1,$A$2:INDEX($A$2:$A$100,MATCH($G2,$B$2:$B$100,0)),C$2:INDEX(C$2:C$100,MATCH($G2,$B$2:$B$100,0)),"No match",0,-1)
Thanks Eric for providing the formula.
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,453
Members
448,967
Latest member
grijken

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