Index and Match with data in intervals (length and width)

dennistran

New Member
Joined
Jan 12, 2018
Messages
4
Hi forum,

I'm new to this forum and relatively new to Excel and its functions. I have an Excel problem that I cannot solve easily by myself. I've tried googling and YouTubing without any progression.

I work as a controller at a company in the Stone Industry and I have the responsibility to price our inventory. Now, the price of the stone is depending on the guaranteed length and width that the customer can use in his production. Therefore, there is a matrix of length and width with respectively price, see picture.

Picture 1: https://ibb.co/iA7P96


Now I want to lookup these values according to picture 2: https://ibb.co/cq7wNR

I will use the top row as an example. Where L = 195 and W = 184
The logic is to first determine the guaranteed length of the block and it is over 191-
Thereafter, we determine the width which is over 101-
This returns the value 47 000.

Can you please help me with the logical function of this problem?

I can post the workbook if you want.



Kind regards,
Dennis Tran
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Dennis - Hi

I've entered the values in picture 1 into a sheet called 'Lookup' and added 1 column and 1 row, both of which show the minimum Length/Width for that range, e.g.

[TABLE="width: 448"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD]Length[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]Width[/TD]
[TD]-70[/TD]
[TD]71-100[/TD]
[TD]101-130[/TD]
[TD]131-190[/TD]
[TD]191-[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Min [/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]71[/TD]
[TD="align: right"]101[/TD]
[TD="align: right"]131[/TD]
[TD="align: right"]191[/TD]
[/TR]
[TR]
[TD]-50[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]22800[/TD]
[TD="align: right"]23800[/TD]
[TD="align: right"]25000[/TD]
[TD="align: right"]33200[/TD]
[TD="align: right"]38400[/TD]
[/TR]
[TR]
[TD]50-70[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]27400[/TD]
[TD="align: right"]31700[/TD]
[TD="align: right"]35100[/TD]
[TD="align: right"]37000[/TD]
[TD="align: right"]40400[/TD]
[/TR]
[TR]
[TD]71-100[/TD]
[TD="align: right"]71[/TD]
[TD][/TD]
[TD="align: right"]24400[/TD]
[TD="align: right"]39800[/TD]
[TD="align: right"]42300[/TD]
[TD="align: right"]45000[/TD]
[/TR]
[TR]
[TD]101-[/TD]
[TD="align: right"]101[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]40100[/TD]
[TD="align: right"]44550[/TD]
[TD="align: right"]47000[/TD]
[/TR]
</tbody><colgroup><col span="7"></colgroup>[/TABLE]


(which I hope shows in 'Bold'!)- obviously you could hide the extra row/column if you don't need to see them!

then the formula to get the corresponding value becomes:
=INDEX(Lookup!C4:G7,MATCH(B2,Lookup!B4:B7,1),MATCH(B1,Lookup!C3:G3,1))

where 'B2' holds the length you are looking up, and 'B1' holds the width

I've tried various sizes and they all appear to work!

Ed
 
Upvote 0
Wow, never readly thought about it but now when I think about it, it really feels so logical! So the ending 1 in the Match function returns less?

I don’t have my worksheet with me right now but come Monday I will definitely try this out.

Thanks Ed.
 
Upvote 0
If you can't / don't want to add another row/column then you could reformat the existing entries and do something like this:


Book1
ABCDEF
1Length
2Width000-070071-100101-130131-190191-
3000-0502280023800250003320038400
4050-0702740031700351003700040400
5071-10024400398004230045000
6101-401004450047000
7
8
9LWLookup
1019518447000
11746931700
121036935100
13755731700
Sheet1
Cell Formulas
RangeFormula
C10=INDEX($B$3:$F$6,MATCH(TEXT($B10,"000-Z"),$A$3:$A$6,1),MATCH(TEXT($A10,"000-Z"),$B$2:$F$2,1))


WBD
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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