VLookup Match Function for Range

Steveym

New Member
Joined
Jun 6, 2023
Messages
9
Office Version
  1. 365
Good morning, I have a table I would like to populate automatically if the values lie within a specific range.

In the example attached, I would like to populate Table 1 with data from the depth ranges from Table 2.

For example in Table 2 between 0 and 0.8 the value is '401' so this has populated correctly in the '401' column across the corresponding depth range in Table 1.

Many thanks for any help.

Steven
 

Attachments

  • Example.JPG
    Example.JPG
    236.7 KB · Views: 18

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try (somewhat tested) in B4 and copy across and down the sheet

=SUMPRODUCT(($A4>=$Z$5:$Z$7)*($A4<$AA$5:$AA$7)*(B$3=INDEX($AB$5:$AB$7,MATCH($A4,$Z$5:$Z7,1),1)))
 
Upvote 0
Excellent, many thanks!
Are you sure? Doesn't that formula include some incorrect '1' values (orange below) and miss some required '1' values (green) compared to your image?

23 08 09.xlsm
ABCJSTUVWXYZAAAB
3201401509520525701801805
40.0501000000
50.10100000000.8401
60.15010000000.81.2201
70.2010000001.22509
80.2501000000
90.301000000
100.3501000000
110.401000000
120.4501000000
130.501000000
140.5501000000
150.601000000
160.6501000000
170.701000000
180.7501000000
190.810000000
200.8510000000
210.910000000
220.9510000000
23110000000
241.0510000000
251.110000000
261.1510000000
271.200100000
281.2500100000
291.300100000
301.3500100000
311.400100000
321.4500100000
331.500100000
341.5500100000
351.600100000
361.6500100000
371.700100000
381.7500100000
391.800100000
401.8500100000
411.900100000
421.9500100000
43200000000
Table (2)
Cell Formulas
RangeFormula
C4:C43,J4:J43,S4:X43C4=SUMPRODUCT(($B4>=$Z$5:$Z$7)*($B4<$AA$5:$AA$7)*(C$3=INDEX($AB$5:$AB$7,MATCH($B4,$Z$5:$Z$7,1),1)))


Since you have Excel 365, would this work for you instead?

23 08 09.xlsm
BCJSXYZAAAB
1
2
3201401509805
40.05 1  
50.1 1  00.8401
60.15 1  0.81.2201
70.2 1  1.22509
80.25 1  
90.3 1  
100.35 1  
110.4 1  
120.45 1  
130.5 1  
140.55 1  
150.6 1  
160.65 1  
170.7 1  
180.75 1  
190.8 1  
200.851   
210.91   
220.951   
2311   
241.051   
251.11   
261.151   
271.21   
281.25  1 
291.3  1 
301.35  1 
311.4  1 
321.45  1 
331.5  1 
341.55  1 
351.6  1 
361.65  1 
371.7  1 
381.75  1 
391.8  1 
401.85  1 
411.9  1 
421.95  1 
432  1 
Table
Cell Formulas
RangeFormula
C4:C43,J4:J43,S4:S43,X4:X43C4=IF(XLOOKUP($B4,$AA$5:$AA$7,$AB$5:$AB$7,,1)=C$3,1,"")
 
Upvote 0
Are you sure? Doesn't that formula include some incorrect '1' values (orange below) and miss some required '1' values (green) compared to your image?

23 08 09.xlsm
ABCJSTUVWXYZAAAB
3201401509520525701801805
40.0501000000
50.10100000000.8401
60.15010000000.81.2201
70.2010000001.22509
80.2501000000
90.301000000
100.3501000000
110.401000000
120.4501000000
130.501000000
140.5501000000
150.601000000
160.6501000000
170.701000000
180.7501000000
190.810000000
200.8510000000
210.910000000
220.9510000000
23110000000
241.0510000000
251.110000000
261.1510000000
271.200100000
281.2500100000
291.300100000
301.3500100000
311.400100000
321.4500100000
331.500100000
341.5500100000
351.600100000
361.6500100000
371.700100000
381.7500100000
391.800100000
401.8500100000
411.900100000
421.9500100000
43200000000
Table (2)
Cell Formulas
RangeFormula
C4:C43,J4:J43,S4:X43C4=SUMPRODUCT(($B4>=$Z$5:$Z$7)*($B4<$AA$5:$AA$7)*(C$3=INDEX($AB$5:$AB$7,MATCH($B4,$Z$5:$Z$7,1),1)))


Since you have Excel 365, would this work for you instead?

23 08 09.xlsm
BCJSXYZAAAB
1
2
3201401509805
40.05 1  
50.1 1  00.8401
60.15 1  0.81.2201
70.2 1  1.22509
80.25 1  
90.3 1  
100.35 1  
110.4 1  
120.45 1  
130.5 1  
140.55 1  
150.6 1  
160.65 1  
170.7 1  
180.75 1  
190.8 1  
200.851   
210.91   
220.951   
2311   
241.051   
251.11   
261.151   
271.21   
281.25  1 
291.3  1 
301.35  1 
311.4  1 
321.45  1 
331.5  1 
341.55  1 
351.6  1 
361.65  1 
371.7  1 
381.75  1 
391.8  1 
401.85  1 
411.9  1 
421.95  1 
432  1 
Table
Cell Formulas
RangeFormula
C4:C43,J4:J43,S4:S43,X4:X43C4=IF(XLOOKUP($B4,$AA$5:$AA$7,$AB$5:$AB$7,,1)=C$3,1,"")
Great thankyou
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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