Finding cell with highest/lowest index from dropdown list?

mwl_y

New Member
Joined
May 23, 2024
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Wasn't too sure how to word this, but here is the situation:
- A table ("Table1") with several columns; focus is on columns 1,2,4
- Column 4 contains a dropdown menu, which uses the list called "Steps", which is defined as G2:G6
- I need to find a given person's most/least progressed step (the "task" doesn't matter)

I know I can use
VBA Code:
=UNIQUE(FILTER(Table1[Current Step],(Table1[Team]=G13)*(Table1[Name]=H13)))
to find the details matching my team and name criteria (and filter out any duplicates), but is there a way to get specifically the value with the lowest index from the "Steps" list? I know INDEX(Steps,[index]) will return the corresponding item on the list, but is there a way to get the opposite info?

See below; the selected area shows what my expected outputs are for what I need.
1718220022202.png
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try:

Book2
ABCDEFGHIJ
1TeamNameTaskCurrent StepSteps
2REDAbbyABCContructionContruction
3REDBrittABCContructionCreate a plan
4REDBrittDEFCreate a planGather materials
5YELLOWCharlesDEFGather materialsFinishing touches
6YELLOWDanielGHIGather materialsComplete
7ORANGEDanielJKLFinishing touches
8YELLOWEricABCFinishing touches
9ORANGEEricDEFFinishing touches
10ORANGEEricGHIGather materials
11ORANGEFeliciaGHIContruction
12GREENGeorgeJKLContructionTeamNameLeast progressMost progress
13GREENHarleyMNOCompleteBLUEJulieGather materialsComplete
14BLUEJuliePQRFinishing touches
15BLUEJulieMNOComplete
16BLUEJuliePQRGather materials
Sheet1
Cell Formulas
RangeFormula
I13:J13I13=LET(f,FILTER(Table1[Current Step],(Table1[Team]=G13)*(Table1[Name]=H13)),TAKE(SORTBY(f,XMATCH(f,Steps)),{1,-1}))
Dynamic array formulas.
 
Upvote 0
See if this does what you need:
Book1
ABCDEFGHIJ
1TeamNameTaskCurrent StepSteps
2REDAbigailConstructionCreate a plan
3REDBrittanyConstructionGather materials
4REDBrittanyCreate a planConstruction
5YELLOWCharlesGather materialsFinishing touches
6YELLOWDanielGather materialsComplete
7ORANGEDanielFinishing touches
8YELLOWEricFinishing touches
9ORANGEEricGather materials
10ORANGEEricConstruction
11ORANGEFeliciaConstruction
12GREENGeorgeCompleteTeamNameLeast ProgressMost Progress
13GREENHarleyFinishing touchesBLUEJulieGather materialsComplete
14GREENIanConstruction
15BLUEJulieComplete
16BLUEJulieGather materials
Sheet4
Cell Formulas
RangeFormula
I13I13=IFERROR(INDEX($G$2:$G$6,MIN(XMATCH(UNIQUE(FILTER(Table1[Current Step],(Table1[Team]=G13)*(Table1[Name]=H13))),$G$2:$G$6,0))),"")
J13J13=IFERROR(INDEX($G$2:$G$6,MAX(XMATCH(UNIQUE(FILTER(Table1[Current Step],(Table1[Team]=G13)*(Table1[Name]=H13))),$G$2:$G$6,0))),"")
Cells with Data Validation
CellAllowCriteria
D2:D16List=$G$2:$G$6
 
Upvote 1
Solution
Another way:

Book1
ABCDEFGHIJ
1TeamNameTaskCurrent StepSteps
2REDAbigailABCConstructionCreate a plan
3REDBrittanyABCConstructionGather materials
4REDBrittanyDEFCreate a planConstruction
5YELLOWCharlesDEFGather materialsFinishing touches
6YELLOWDanielGHIGather materialsComplete
7ORANGEDanielJKLFinishing touches
8YELLOWEricABCFinishing touches
9ORANGEEricDEFGather materials
10ORANGEEricGHIConstruction
11ORANGEFeliciaGHIConstruction
12GREENGeorgeJKLCompleteTeamNameLeast ProgressMost Progress
13GREENHarleyMNOFinishing touchesBLUEJULIEGather materialsComplete
14GREENIanPQRConstruction
15BLUEJulieMNOComplete
16BLUEJuliePQRGather materials
17
Sheet2
Cell Formulas
RangeFormula
I13:J13I13=INDEX(G2:G6,AGGREGATE({15,14},6,MATCH(Table1[Current Step],G2:G6,0)/(Table1[Team]=G13)/(Table1[Name]=H13),1))
Dynamic array formulas.
 
Upvote 0
Try:

Book2
ABCDEFGHIJ
1TeamNameTaskCurrent StepSteps
2REDAbbyABCContructionContruction
3REDBrittABCContructionCreate a plan
4REDBrittDEFCreate a planGather materials
5YELLOWCharlesDEFGather materialsFinishing touches
6YELLOWDanielGHIGather materialsComplete
7ORANGEDanielJKLFinishing touches
8YELLOWEricABCFinishing touches
9ORANGEEricDEFFinishing touches
10ORANGEEricGHIGather materials
11ORANGEFeliciaGHIContruction
12GREENGeorgeJKLContructionTeamNameLeast progressMost progress
13GREENHarleyMNOCompleteBLUEJulieGather materialsComplete
14BLUEJuliePQRFinishing touches
15BLUEJulieMNOComplete
16BLUEJuliePQRGather materials
Sheet1
Cell Formulas
RangeFormula
I13:J13I13=LET(f,FILTER(Table1[Current Step],(Table1[Team]=G13)*(Table1[Name]=H13)),TAKE(SORTBY(f,XMATCH(f,Steps)),{1,-1}))
Dynamic array formulas.
Thanks Cubist! This sort of works, but only if there are only two different stages... if there were a third task for Julie in team Blue, then it would spill over and show three separate stages in order, rather than just the least and most progressed.

Sorry I didn't specify this, but I do need two separate formulas for each of the cells...
 
Upvote 0
See if this does what you need:
Book1
ABCDEFGHIJ
1TeamNameTaskCurrent StepSteps
2REDAbigailConstructionCreate a plan
3REDBrittanyConstructionGather materials
4REDBrittanyCreate a planConstruction
5YELLOWCharlesGather materialsFinishing touches
6YELLOWDanielGather materialsComplete
7ORANGEDanielFinishing touches
8YELLOWEricFinishing touches
9ORANGEEricGather materials
10ORANGEEricConstruction
11ORANGEFeliciaConstruction
12GREENGeorgeCompleteTeamNameLeast ProgressMost Progress
13GREENHarleyFinishing touchesBLUEJulieGather materialsComplete
14GREENIanConstruction
15BLUEJulieComplete
16BLUEJulieGather materials
Sheet4
Cell Formulas
RangeFormula
I13I13=IFERROR(INDEX($G$2:$G$6,MIN(XMATCH(UNIQUE(FILTER(Table1[Current Step],(Table1[Team]=G13)*(Table1[Name]=H13))),$G$2:$G$6,0))),"")
J13J13=IFERROR(INDEX($G$2:$G$6,MAX(XMATCH(UNIQUE(FILTER(Table1[Current Step],(Table1[Team]=G13)*(Table1[Name]=H13))),$G$2:$G$6,0))),"")
Cells with Data Validation
CellAllowCriteria
D2:D16List=$G$2:$G$6
Thanks @dreid1011 ! I think this covers what I need. I'll test it out :)
 
Upvote 0
Thanks Cubist! This sort of works, but only if there are only two different stages... if there were a third task for Julie in team Blue, then it would spill over and show three separate stages in order, rather than just the least and most progressed.
I don't think my formula is doing that.

Sorry I didn't specify this, but I do need two separate formulas for each of the cells...
I would go with Eric's formula (from an efficiency perspective).
 
Upvote 0
If you want 2 separate formulas, you can just split my formula in 2 pieces by breaking up the {15,14} array like this:

Book1
GHIJ
12TeamNameLeast ProgressMost Progress
13BLUEJULIEGather materialsComplete
Sheet2
Cell Formulas
RangeFormula
I13I13=INDEX(G2:G6,AGGREGATE(15,6,MATCH(Table1[Current Step],G2:G6,0)/(Table1[Team]=G13)/(Table1[Name]=H13),1))
J13J13=INDEX(G2:G6,AGGREGATE(14,6,MATCH(Table1[Current Step],G2:G6,0)/(Table1[Team]=G13)/(Table1[Name]=H13),1))


Both versions put the same results in 2 different cells, so functionally they're the same. Also, I intentionally did not use an IFERROR function, because an error in this case would probably denote a problem in the data, which you'd want to know about.
 
Upvote 1
If you want 2 separate formulas, you can just split my formula in 2 pieces by breaking up the {15,14} array like this:

Book1
GHIJ
12TeamNameLeast ProgressMost Progress
13BLUEJULIEGather materialsComplete
Sheet2
Cell Formulas
RangeFormula
I13I13=INDEX(G2:G6,AGGREGATE(15,6,MATCH(Table1[Current Step],G2:G6,0)/(Table1[Team]=G13)/(Table1[Name]=H13),1))
J13J13=INDEX(G2:G6,AGGREGATE(14,6,MATCH(Table1[Current Step],G2:G6,0)/(Table1[Team]=G13)/(Table1[Name]=H13),1))


Both versions put the same results in 2 different cells, so functionally they're the same. Also, I intentionally did not use an IFERROR function, because an error in this case would probably denote a problem in the data, which you'd want to know about.
Thanks @Eric W ! This works great :)
 
Upvote 0
If you want 2 separate formulas, you can just split my formula in 2 pieces by breaking up the {15,14} array like this:

Book1
GHIJ
12TeamNameLeast ProgressMost Progress
13BLUEJULIEGather materialsComplete
Sheet2
Cell Formulas
RangeFormula
I13I13=INDEX(G2:G6,AGGREGATE(15,6,MATCH(Table1[Current Step],G2:G6,0)/(Table1[Team]=G13)/(Table1[Name]=H13),1))
J13J13=INDEX(G2:G6,AGGREGATE(14,6,MATCH(Table1[Current Step],G2:G6,0)/(Table1[Team]=G13)/(Table1[Name]=H13),1))


Both versions put the same results in 2 different cells, so functionally they're the same. Also, I intentionally did not use an IFERROR function, because an error in this case would probably denote a problem in the data, which you'd want to know about.
The reason I used IFERROR was to hide the error when changing the lookup values since INDEX doesn't have a convenient "if not found" option.
 
Upvote 0

Forum statistics

Threads
1,224,746
Messages
6,180,705
Members
452,994
Latest member
Janick

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