Return Value from range based on lowest score

RJB78

Board Regular
Joined
Aug 8, 2016
Messages
73
Office Version
  1. 365
Hello - looking for a formula that will return a value based on 2 variables. Example below. When I type orange, I want the formula to look through the data and return the store name with the lowest price oranges. If I type apple, I want the store with the lowest price apples, etc. Thank you in advance.

Find:Orange
Store:FORMULA HERE

Store 1Orange$1
Store 2Orange$2
Store 3Orange$3
Store 1Apple$6
Store 2Apple$7
Store 3Apple$4
Store 1Banana$10
Store 2Banana$11
Store 3Banana$9
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
This should work, although I'm sure there are even ways.....

Duplicate.xlsx
ACADAE
30Find:Apple
31Store:Store 3
32
33Store 1Orange$1
34Store 2Orange$2
35Store 3Orange$3
36Store 1Apple$6
37Store 2Apple$7
38Store 3Apple$4
39Store 1Banana$10
40Store 2Banana$11
41Store 3Banana$9
Sheet1
Cell Formulas
RangeFormula
AD31AD31=INDEX(AC33:AE41,MATCH(MIN(FILTER((AC33:AE41),(AD33:AD41)=AD30)),AE33:AE41),1)
 
Upvote 0
@RJB78 here is an update with a second option:

Duplicate.xlsx
ACADAEAF
30Find:Apple
31Option1:Store 3Option2:Store 3
32
33Store 1Orange$1
34Store 2Orange$2
35Store 3Orange$3
36Store 1Apple$6
37Store 2Apple$7
38Store 3Apple$4
39Store 1Banana$10
40Store 2Banana$11
41Store 3Banana$9
Sheet1
Cell Formulas
RangeFormula
AD31AD31=INDEX(AC33:AE41,MATCH(MIN(FILTER((AC33:AE41),(AD33:AD41)=AD30)),AE33:AE41),1)
AF31AF31=LET( input1, AC33:AE41, input2, AD33:AD41, input3, AE33:AE41, field, AD30, input4, FILTER(input1, input2 = field), input5, SMALL(input4,1), input6, FILTER(input1, input3 = input5), Result, VSTACK(HSTACK(DROP(input6,,-2))), Result )
 
Upvote 0
Another option:
Book1
ABC
1Find:Apple
2Store:Store 3
3
4
5Store 1Orange1
6Store 2Orange2
7Store 3Orange3
8Store 1Apple6
9Store 2Apple7
10Store 3Apple4
11Store 1Banana10
12Store 2Banana11
13Store 3Banana9
Sheet1
Cell Formulas
RangeFormula
B2B2=FILTER(A5:A13,(B5:B13=B1)*(C5:C13=MINIFS(C5:C13,B5:B13,B1)),"")
 
Upvote 0
Another option:

Book1
ABC
1Find:Apple
2Store:Store 3
3
4Store 1Orange$1
5Store 2Orange$2
6Store 3Orange$3
7Store 1Apple$6
8Store 2Apple$7
9Store 3Apple$4
10Store 1Banana$10
11Store 2Banana$11
12Store 3Banana$9
13
14
15
Sheet2
Cell Formulas
RangeFormula
B2B2=INDEX(SORT(FILTER(A4:C15,B4:B15=B1),3),1,1)


If you change it like this:

Excel Formula:
=INDEX(SORT(FILTER(A4:C15,B4:B15=B1),3),1,{1,3})

it will also show the amount.
 
Upvote 0

Forum statistics

Threads
1,226,465
Messages
6,191,185
Members
453,646
Latest member
BOUCHOUATA

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