Find from list

Beatrice

Board Regular
Joined
Sep 17, 2019
Messages
85
Office Version
  1. 2019
Platform
  1. Windows
greeting, I need some help to look for the related prices, example list as below:


Length (cm)Width (cm)PRICE
2535
200​
3550
300​
3370
350​
4157
400​
4664
500​
5070
600​
5782
800​
6490
1000​
70100
1200​

I need a formula not only look for the exact value, but also include the odd sizes not from the list. (equal or greater than)
for example, 60 x 85 should take PRICE at 1000.
another example 45 x 75 will have to take PRICE 1200 (rotated to fit)

Thank you in advance for helping.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi,
I have made a solution. It is based on the assumption that on the price list width is alsways greater than length.

Book2
ABCDEFG
1Length (cm)Width (cm)PRICELWPrice
225352001264350
33550300
43370350
54157400
64664500
75070600
85782800
964901000
10701001200
Sheet2
Cell Formulas
RangeFormula
G2G2=INDEX(C1:C10,MIN(IF(A2:A10>=MIN(E2,F2),IF(B2:B10>=MAX(E2:F2),ROW(A2:A10),1000),1000)))
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0
Thanks J.Ty

I have tried to adapt exactly the same,but it turns out different answer.
do you know why?

1584064711929.png

I uploaded the file to wetransfer.com : 5445627.xlsx
if you don't mind, could you please let me know what I have done wrong?
Thanks a lot.
 
Upvote 0
I have made the necessary correction, as shown below. The problem was that I used ROW function, which returns the row number of the cell which is the argument. In general, formulas which use ROW (and analogous COLUMN function) can be affected by changes made to the spreadsheet design, like relocating the data. I have made the formula independent of this.
Additionally, I have added a mechanism which gives a polite answer "not available" instead of an error if the requested object is larger than anything you have in your data.

At the moment the formula returns the first item (from top) which matches the input size, so it will be the cheapest one. If you want any alternative mechanism, please let me know.

The spreadsheet is available here.

Beatrice.xlsx
BCD
1Size range (cm)Price
210160not available
3
4Size range (cm)Price
52535200
63550300
73370350
84157400
94664500
105070600
115782800
1264901,000
13701001,200
MrExcel
Cell Formulas
RangeFormula
D2D2=IFERROR(INDEX(D5:D13,MIN(IF(B5:B13>=MIN(B2,C2),IF(C5:C13>=MAX(B2:C2),ROW(B5:B13)-ROW(D4),10^7),10^7))),"not available")
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0
Thank you, it works perfectly. :)
just wonder what is "10^7"? I want to understand so I can use it for future.
Thanks a lot
 
Upvote 0
10^7 is 10000000 and is returned in place of a row number in case the item is too small. MIN chooses the smallest row number of all, so if all items are too small, you get 10^7 which i more than any row number in an Excel worksheet. That guarantees that you do not get an accidental row from your data.

If you want to understad how this all works, you can use formula evaluator. Select the cell with your formula, go to Ribbon -> Formulas-> Evaluate Formula (icon with a magnifying glass with fx inside) and click. A small window appears with your formula. With each click on the Evaluate button, you can watch how the subformulas of your formula turn into values. Very instructive and helpful.
 
Upvote 0
Thank you for your explanation, indeed much thanks for being so patient with me.
I still have a lot learn obviously ?

Have a good day :)
 
Upvote 0
Thanks for the feedback and good luck!

J.Ty.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,862
Members
449,052
Latest member
Fuddy_Duddy

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