Find result in table with multiple columns and return row header with formula

Bengo

Board Regular
Joined
Apr 14, 2010
Messages
210
Hi,

Trying to get the row header based on a cell value in a table with multiple columns

I am looking for the highest sales day over a period of time which is fine. But then I need to know which week that occured in

So for example in the image here, the max sales of 17,259 needs to return the date 07-May-17

I have tried this but this returns a #n/a error. Many thanks

=INDEX('workbook.xls]sheet1'!$A$3:$A$54,MATCH(MAX('[workbook.xls]sheet1'!$C$3:$I$54),'[wokbook.xls]sheet1'!$C$3:$I$54,0))
 

Attachments

  • mr excel.JPG
    mr excel.JPG
    42.6 KB · Views: 18

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Try
Excel Formula:
=INDEX([workbook.xls]sheet1!$A$3:$A$54,AGGREGATE(14,6,(ROW([workbook.xls]sheet1!$A$3:$A$54)-ROW([workbook.xls]sheet1!$A$3)+1)/([workbook.xls]sheet1!$C$3:$I$54=MAX([workbook.xls]sheet1!$C$3:$I$54)),1))
 
Upvote 0
Hi Bengo,

MATCH won't work on a matrix, only cells in a single row or column.

I see @Fluff has beaten me again to posting a solution so I must go a step further and handle duplicate maximum sales values (here 7 May 2017 and 17 June 2017) and provide a list of the "Top 10" sales weeks.

Bengo.xlsx
ABCDEFGHI
1
2W/EMondayTuesdayWednesdayThursdayFridaySaturdaySunday
309-Apr-1772835373825027731513359614492
416-Apr-17800210736146714291608194725760
523-Apr-1762068714835230247801139932515
630-Apr-171075561961628210077996977663616
707-May-174236535651938934129491725915130
814-May-171137414589674398827355151137558
921-May-1777408259459033706252373514603
1028-May-1716122494614564589247051499711794
1104-Jun-1725361434613358906113757601512806
1211-Jun-1731582537107774372142471451510124
1318-Jun-1714473133292872105615162999110839
1425-Jun-173551151301513013650119201725914252
1502-Jul-17471711214689113797554671534833
Sheet1
Cell Formulas
RangeFormula
B4:B15B4=B3+7


Cell Formulas
RangeFormula
A2:A11A2=COUNTIF($B$2:$B$11,">"&B2)+1
B2:B11B2=AGGREGATE(14,6,Sheet1!$C$3:$I$9999,ROW()-ROW($B$1))
C2:C11C2=INDEX(Sheet1!$B$3:$B$9999,AGGREGATE(15,6,ROW(Sheet1!$B$3:$B$9999)-ROW(Sheet1!$B$2)/((Sheet1!$C$3:$I$9999=B2)),COUNTIF($B$1:$B2,B2)))
 
Upvote 0
Try
Excel Formula:
=INDEX([workbook.xls]sheet1!$A$3:$A$54,AGGREGATE(14,6,(ROW([workbook.xls]sheet1!$A$3:$A$54)-ROW([workbook.xls]sheet1!$A$3)+1)/([workbook.xls]sheet1!$C$3:$I$54=MAX([workbook.xls]sheet1!$C$3:$I$54)),1))
Thanks so much this has worked perfectly!! I need to go away and figure out what that is doing, but for now I have created the model I am after!! Ver much appreciated!
 
Upvote 0
Hi Bengo,

MATCH won't work on a matrix, only cells in a single row or column.

I see @Fluff has beaten me again to posting a solution so I must go a step further and handle duplicate maximum sales values (here 7 May 2017 and 17 June 2017) and provide a list of the "Top 10" sales weeks.

Bengo.xlsx
ABCDEFGHI
1
2W/EMondayTuesdayWednesdayThursdayFridaySaturdaySunday
309-Apr-1772835373825027731513359614492
416-Apr-17800210736146714291608194725760
523-Apr-1762068714835230247801139932515
630-Apr-171075561961628210077996977663616
707-May-174236535651938934129491725915130
814-May-171137414589674398827355151137558
921-May-1777408259459033706252373514603
1028-May-1716122494614564589247051499711794
1104-Jun-1725361434613358906113757601512806
1211-Jun-1731582537107774372142471451510124
1318-Jun-1714473133292872105615162999110839
1425-Jun-173551151301513013650119201725914252
1502-Jul-17471711214689113797554671534833
Sheet1
Cell Formulas
RangeFormula
B4:B15B4=B3+7


Cell Formulas
RangeFormula
A2:A11A2=COUNTIF($B$2:$B$11,">"&B2)+1
B2:B11B2=AGGREGATE(14,6,Sheet1!$C$3:$I$9999,ROW()-ROW($B$1))
C2:C11C2=INDEX(Sheet1!$B$3:$B$9999,AGGREGATE(15,6,ROW(Sheet1!$B$3:$B$9999)-ROW(Sheet1!$B$2)/((Sheet1!$C$3:$I$9999=B2)),COUNTIF($B$1:$B2,B2)))
Thanks very much for this, helps explain the above much more easily, will have a good read through! thanks again
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,557
Members
449,088
Latest member
davidcom

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