VLookup, Index, match or something else needed please.

GAJITCS

Board Regular
Joined
Apr 21, 2015
Messages
66
I have the following table to search: A1:D10

ISOStartEndCHG
DE111
DE10202
DE21304
DE40555
DK10208
DK21309
EE21303
EE40556
EE56567

<tbody>
</tbody>

For each of these records, I need to return the CHG value from column D where from the table below, the ISO field is a match and the PC field is between the Start and End values inclusive.

That is to say:

ISO = DE and PC = 1 in the table below should bring back the value of 1 from D2 above.
ISO = DE and PC = 44 in the table below should bring back the value of 5 from D5 above.
ISO = DK and PC = 3 in the table below should not return a value from the table above.
ISO = EE and PC = 55 in the table below should bring back the value of 6 from D9 above.

ISOPCCHG
DE1
DE10
DE44
DE20
DE31
DK3
DK10
DK15
DK30
DK31
EE1
EE21
EE55
EE56
EE57

<tbody>
</tbody>


I am looking for Formula based answers is possible please.


Many thanks for your time.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
The 1st table you said is in A1:D10

The 2nd table, I put in H1:J16

Formula in J2 is
=IFERROR(INDEX($D$2:$D$10,MATCH(1,INDEX(($A$2:$A$10=H2)*(I2>=$B$2:$B$10)*(I2<=$C$2:$C$10),0),0)),"")
 
Upvote 0
The 1st table you said is in A1:D10

The 2nd table, I put in H1:J16

Formula in J2 is
=IFERROR(INDEX($D$2:$D$10,MATCH(1,INDEX(($A$2:$A$10=H2)*(I2>=$B$2:$B$10)*(I2<=$C$2:$C$10),0),0)),"")

Many thanks. That does exactly what I need of it.

The more I do, the more I realise two things. 1) How capable Excel is. 2) How I've only scratched the surface.

My next task is to understand why this works.
 
Upvote 0

Forum statistics

Threads
1,215,706
Messages
6,126,344
Members
449,311
Latest member
accessbob

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