Find maximum values in table and return values from different columns in the same table.

Munch91

New Member
Joined
Dec 13, 2020
Messages
4
Office Version
  1. 2013
Platform
  1. Windows
I have the following dummy table from which I need to determine two different sets of maximum value and their corresponding information.

The first set of values I need to find is the highest value in Column S "Store" of the table and return that value into Cell V2. If there are multiple entries of the same value, then it needs to be the most recent of those according to the date in Column A "Date" of the table. Cells V3 & V4 need to provide the corresponding Date and Day value from the row that the highest value is located in respectively. So for the example table below it needs to return the following:

Cell V2: 60
Cell V3: 12-Feb-59
Cell V4: Wednesday

The second set of values is a bit more complicated. I need to look at all of the tabled values in Columns D-R as a whole ("Freezer" - "Aisle 14") and find the highest single value out of all of them and return that value in Cell V6, again if there are multiple values all the same, then it needs to be the most recent value according to the date in Column A "Date". Similar to the first example, I then need to find the corresponding Date and Day value from the row that the highest value is located in and return those into Cell V7 & V8 respectively. On top of this I need to also find the corresponding column name from which the highest value came from to give the following information:

Cell V6:145
Cell V7: 28-Apr-09
Cell V8: Tuesday
Cell V9: Aisle 10

The table will eventually contain many more rows of data, so I cant work with just the range of information already in the table.

DUMMY SHEET 2.xlsm
ABCDEFGHIJKLMNOPQRSTUV
1DateDayLoad TypeFreezerDairyAisle 2Aisle 3Aisle 4Aisle 5Aisle 6Aisle 7Aisle 8Aisle 9Aisle 10Aisle 11Aisle 12Aisle 13Aisle 14STORE
212-Feb-59WednesdayDouble Sydney33486277436761826470975850767260MAXIMUM STORE VALUE (S)
326-Dec-62FridayTriple29467581476871833965825144636858Corresponding Date
421-May-83TuesdayNo NDC366836706356864033393720493211151Corresponding Day
515-Oct-83FridayNo NDC3563441104466854448434533656613158
609-Jan-86SaturdayDouble Sydney/Melbourne284276764851536664561014754628757MAXIMUM VALUE (D-R)
718-Jul-91ThursdaySingle Sydney33496269436068915177785246617758Correspoding Date
828-Nov-96ThursdayDouble Melbourne35584467415775805767875344515958Corresponding Day
928-Apr-09TuesdaySingle Melbourne233466844148946757561455345646052Corresponding Column Name
1011-Jun-13SaturdayNo NDC356344734466854448433033656613156
1110-Jan-19WednesdaySingle Sydney34556273255467616757667451878958
12
13
TEST CARTON RATE
Cell Formulas
RangeFormula
D2:D11D2=CartonCount4[@Freezer]/AisleHours8[@Freezer]
E2:E11E2=CartonCount4[@Dairy]/AisleHours8[@Dairy]
F2:F11F2=CartonCount4[@[Aisle 2]]/AisleHours8[@[Aisle 2]]
G2:G11G2=CartonCount4[@[Aisle 3]]/AisleHours8[@[Aisle 3]]
H2:H11H2=CartonCount4[@[Aisle 4]]/AisleHours8[@[Aisle 4]]
I2:I11I2=CartonCount4[@[Aisle 5]]/AisleHours8[@[Aisle 5]]
J2:J11J2=CartonCount4[@[Aisle 6]]/AisleHours8[@[Aisle 6]]
K2:K11K2=CartonCount4[@[Aisle 7]]/AisleHours8[@[Aisle 7]]
L2:L11L2=CartonCount4[@[Aisle 8]]/AisleHours8[@[Aisle 8]]
M2:M11M2=CartonCount4[@[Aisle 9]]/AisleHours8[@[Aisle 9]]
N2:N11N2=CartonCount4[@[Aisle 10]]/AisleHours8[@[Aisle 10]]
O2:O11O2=CartonCount4[@[Aisle 11]]/AisleHours8[@[Aisle 11]]
P2:P11P2=CartonCount4[@[Aisle 12]]/AisleHours8[@[Aisle 12]]
Q2:Q11Q2=CartonCount4[@[Aisle 13]]/AisleHours8[@[Aisle 13]]
R2:R11R2=CartonCount4[@[Aisle 14]]/AisleHours8[@[Aisle 14]]
S2:S11S2=CartonCount4[@TOTAL]/AisleHours8[@TOTAL]
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
How about
+Fluff v2.xlsm
ABCDEFGHIJKLMNOPQRSTUV
1DateDayLoad TypeFreezerDairyAisle 2Aisle 3Aisle 4Aisle 5Aisle 6Aisle 7Aisle 8Aisle 9Aisle 10Aisle 11Aisle 12Aisle 13Aisle 14STORE
212-Feb-59WednesdayDouble Sydney33486277436761826470975850767260MAXIMUM STORE VALUE (S)60
326-Dec-62FridayTriple29467581476871833965825144636858Corresponding Date18/07/1991
421-May-83TuesdayNo NDC366836706356864033393720493211151Corresponding DayThursday
515-Oct-83FridayNo NDC3563441104466854448434533656613158
609-Jan-86SaturdayDouble Sydney/Melbourne2842767648511456664561014754628757MAXIMUM VALUE (D-R)145
718-Jul-91ThursdaySingle Sydney33496269436068915177785246617760Correspoding Date28/04/2009
828-Nov-96ThursdayDouble Melbourne35584467415775805767875344515958Corresponding DayTuesday
928-Apr-09TuesdaySingle Melbourne233466844148946757561455345646052Corresponding Column NameAisle 10
1011-Jun-13SaturdayNo NDC356344734466854448433033656613156
1110-Jan-19WednesdaySingle Sydney34556273255467616757667451878958
12
Master
Cell Formulas
RangeFormula
V2V2=MAX(Table1[STORE])
V3V3=AGGREGATE(14,6,Table1[Date]/(Table1[STORE]=V2),1)
V4,V8V4=TEXT(V3,"dddd")
V6V6=MAX(Table1[[Freezer]:[Aisle 14]])
V7V7=AGGREGATE(14,6,Table1[Date]/(Table1[[Freezer]:[Aisle 14]]=V6),1)
V9V9=INDEX(Table1[[#Headers],[Freezer]:[Aisle 14]],AGGREGATE(15,6,(COLUMN(Table1[[#Headers],[Freezer]:[Aisle 14]])-COLUMN(Table1[[#Headers],[Freezer]])+1)/(Table1[[Freezer]:[Aisle 14]]=V6)/(Table1[Date]=V7),1))
 
Upvote 0
Solution
Thanks again for your help.

I found the V4 & V8 formula didnt return the right day, it kept returning different ones. I worked around it by doing a VLOOKUP in there and referenced the results from Cells V3 & V6 respectively to find the associated day and that seems to work well when I test it across many dates.
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,947
Messages
6,122,413
Members
449,082
Latest member
tish101

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