Lookup first by description then by price range

bcbuck88

New Member
Joined
Sep 20, 2017
Messages
6
Hello,

This is my first post regarding an issue I've had for some time. I'm looking for formula that provides the Item # after first finding the correct Type then finding where the cost falls within that range. I'm thinking that a combination a Index/Match and vlookup would be best. There are hundreds of products and the cost range can vary greatly. Any assistance would be greatly appreciated!

Description:Product 1
Cost: $30
Item #:?
DescriptionMin Cost Max Cost Item #
Product 1125100001
Product 12650100005
Product 15175100030
Product 2125100033
Product 22650100004
Product 25175100009

<tbody>
</tbody>
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
See if this works for you.RL-
This is an array formula and must be entered with CTRL-SHIFT-ENTER.
Excel Workbook
ABCD
1Description:Product 1
2Cost:$30
3Item #:100005
4
5
6
7DescriptionMin CostMax CostItem #
8Product 1125100001
9Product 12650100005
10Product 15175100030
11Product 2125100033
12Product 22650100004
13Product 25175100009
Sheet
 
Upvote 0
try
=IFERROR(LOOKUP(1E+307,1/((B1=A6:A11)*(B2>=B6:B11)*(B2<=C6:C11))*D6:D11),0)
but you need to change $30 to 30 - so its a number
 
Upvote 0
Excel Workbook
ABCD
1Description:Product 1
2Cost:30
3Item #:100005
4
5DescriptionMin CostMax CostItem #
6Product 1125100001
7Product 12650100005
8Product 15175100030
9Product 2125100033
10Product 22650100004
11Product 25175100009
Sheet1
 
Upvote 0
Another possible,

In B3,

=LOOKUP(B2,OFFSET(B5:D11,MATCH(B1,A6:A11,0),,COUNTIF(A6:A11,B1)))

Regards
Bosco
 
Last edited:
Upvote 0
Wayne,

Thanks so much for the formula it works great! Could we adjust it to include other columns such as Column E (Discount Code) or Column F (Effective Date)?

I've tried changing the array D6:D11 but that returns an error.

=IFERROR(LOOKUP(1E+307,1/((B1=A6:A11)*(B2>=B6:B11)*(B2<=C6:C11))*D6:D11),0)

Thanks again!
Brian
 
Upvote 0
Thank you both to Ahoy and Bosco but I couldn't get either to work. I guess I need more work on Index and Offset :P

Best,
Brian
 
Upvote 0
=iferror(lookup(1e+307,1/((b1=a6:a11)*(b2>=b6:b11)*(b2<=c6:c11))*e6:e11),0)

=iferror(lookup(1e+307,1/((b1=a6:a11)*(b2>=b6:b11)*(b2<=c6:c11))*f6:f11),0)
 
Upvote 0
Excel Workbook
ABCDEF
1Description:Product 2
2Cost:30
3Item #:01/06/2017
4
5DescriptionMin CostMax CostItem #Discount CodeEffective Date
6Product 1125100001101/02/2017
7Product 12650100005201/03/2017
8Product 15175100030301/04/2017
9Product 2125100033401/05/2017
10Product 22650100004501/06/2017
11Product 25175100009601/07/2017
Sheet1
 
Upvote 0
Not exactly sure why but those formulas were not working for me. It may be because the values in columns E and F are text.

What I ended up doing was a simple Vlookup from the Item # to look up the values in the columns.

Thanks for your help, you're a life saver!
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,752
Members
448,989
Latest member
mariah3

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