=Match(Index(Offset(Subtotal()))??????

btadams

Well-known Member
Joined
Jan 6, 2003
Messages
1,943
At the bottom of column D I'm using the Subtotal function to return the min and max in column D (data filtering is applied). I would also like a formula that would return the name associated with the min and max that are in column A.

Any ideas?


Thanks,
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
There are several ways to find the name (vlookup, index & match combos etc) but what I couldnt tell from the Excel doc, was which if any of them act in the same way as subtotal (ie ignore the hidden rows).
 
Upvote 0
Try the following array formula that needs to be confirmed with CONTOL+SHIFT+ENTER...

=INDEX($A$2:$A$10,MATCH(1,(SUBTOTAL(3,OFFSET($A$2:$A$10,ROW($A$2:$A$10)-MIN(ROW($A$2:$A$10)),0,1)))*($D$2:$D$10=F1),0))

...where F1 contains the minimum value obtained by the SUBTOTAL function. Note that if there's more than one value that equals the minimum value, the formula will return the first occurrence of the name associated with that value.

Hope this helps!
 
Upvote 0
Hi

Try:

=VLOOKUP(E23,IF(SUBTOTAL(3,INDIRECT("A"&ROW(INDIRECT("2:21")))),A2:B21,""),2,0)

Needs to be confirmed with Ctrl + shift + enter.
 
Upvote 0
Apologies Mr Fairwinds - I stand corrected (and humble for not reading your instructions to the end - or understanding the formula)
 
Upvote 0
Domenic,
Many Thanks. That does the trick and I was definately following the wrong trail.


Fairwinds,
Couldn't get your formula to work but would like to. I'm assuming E23 contains the max value returned by the Subtotal function and that A2:B21 contains the table or names and values. Correct?
 
Upvote 0
Correct, but as it s a vlookup values must be in first column and name in second. If that is not the case you need to use index match.
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,210
Members
453,023
Latest member
alabaz

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