Find the Largest Improvement Over Personal Best

justafish2002

New Member
Joined
Dec 29, 2015
Messages
12
My Data:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]May[/TD]
[TD]June[/TD]
[TD]July[/TD]
[TD]Aug[/TD]
[TD]Sept[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD]100[/TD]
[TD]50[/TD]
[TD]150[/TD]
[TD]175[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]Paul[/TD]
[TD]50[/TD]
[TD]100[/TD]
[TD]175[/TD]
[TD]250[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD]25[/TD]
[TD]20[/TD]
[TD]150[/TD]
[TD]100[/TD]
[TD]50[/TD]
[/TR]
</tbody>[/TABLE]


I want to find the largest improvement over that person's personal best, so my desired results would be:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Improvement[/TD]
[TD]Month[/TD]
[TD]Month[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD]125[/TD]
[TD]May[/TD]
[TD]July[/TD]
[/TR]
</tbody>[/TABLE]


Some notes: I'd prefer no helper columns if possible. I'd also prefer to do this in a formula since I have to use Google Sheets.

I tried this formula, which works to find the max improvement on an individual row, but not on the data as a whole (since MAX doesn't return an array):
=ArrayFormula(MAX({G4:G666;H4:H666;I4:I666;J4:J666}-{MAX(F4:F666);MAX(F4:G666);MAX(F4:H666);MAX(F4:I666)}))

That formula would also require updating each time a column was added. Something that may be helpful is a formula that can return an array containing the max improvement of each row.
 
Last edited:

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Please clarify what "largest improvement over personal best means".
Does the second example below address your requirement?


Excel 2010
ABCDEFGH
2NameRankMax >MayJuneJulyAugSept
3Bob310010050150175200
4Paul120050100175250200
5Mary2125252015010050
6
7
8NameRankMax >MayJuneJulyAugSept
9Bob35010050150175200
10Paul27550100175250200
11Mary1125252015010050
12
2b
Cell Formulas
RangeFormula
B3=RANK(C3,$C$3:$C$5)
B9=RANK(C9,$C$9:$C$11)
C3=MAX(E3:P3)-D3
C9=MAX(E9-D9,F9-MAX(D9:E9),G9-MAX(D9:F9),H9-MAX(D9:G9))
 
Last edited:
Upvote 0
Maybe this...

[Table="width:, class:grid"][tr][td]Row\Col[/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][td]
E​
[/td][td]
F​
[/td][/tr][tr][td]
1​
[/td][td] Name[/td][td] May[/td][td] June[/td][td] July[/td][td] Aug[/td][td] Sept[/td][/tr]
[tr][td]
2​
[/td][td] Bob[/td][td] 100[/td][td] 50[/td][td] 150[/td][td] 175[/td][td] 200[/td][/tr]
[tr][td]
3​
[/td][td] Paul[/td][td] 50[/td][td] 100[/td][td] 175[/td][td] 250[/td][td] 200[/td][/tr]
[tr][td]
4​
[/td][td] Mary[/td][td] 25[/td][td] 20[/td][td] 150[/td][td] 100[/td][td] 50[/td][/tr]
[tr][td]
5​
[/td][td] Joe[/td][td][/td][td] 70[/td][td] 70[/td][td] 90[/td][td] 75[/td][/tr]
[tr][td]
6​
[/td][td] Damon[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
7​
[/td][td] Linda[/td][td] 80[/td][td] 80[/td][td][/td][td] 95[/td][td][/td][/tr]
[tr][td]
8​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[tr][td]
9​
[/td][td] Name[/td][td] Improve[/td][td] Month[/td][td] Month[/td][td][/td][td][/td][/tr]
[tr][td]
10​
[/td][td] Bob[/td][td] 100[/td][td] May[/td][td] Sept[/td][td][/td][td][/td][/tr]
[tr][td]
11​
[/td][td] Paul[/td][td] 200[/td][td] May[/td][td] Aug[/td][td][/td][td][/td][/tr]
[tr][td]
12​
[/td][td] Mary[/td][td] 125[/td][td] May[/td][td] July[/td][td][/td][td][/td][/tr]
[tr][td]
13​
[/td][td] Joe[/td][td] 20[/td][td] June[/td][td] Aug[/td][td][/td][td][/td][/tr]
[tr][td]
14​
[/td][td] Damon[/td][td] [/td][td] [/td][td] [/td][td][/td][td][/td][/tr]
[tr][td]
15​
[/td][td] Linda[/td][td] 15[/td][td] May[/td][td] Aug[/td][td][/td][td][/td][/tr]
[/table]


In B10 control+shift+enter, not just enter, and copy down:

=IF(COUNT(INDEX($B$2:$F$7,MATCH($A10,$A$2:$A$7,0),0))>1,MAX(IF($A$2:$A$7=$A10,$B$2:$F$7-INDEX($B$2:$F$7,MATCH($A10,$A$2:$A$7,0),MIN(IF($A$2:$A$7=$A10,IF(ISNUMBER($B$2:$F$7),COLUMN($B$2:$F$7)-COLUMN($B$2)+1)))))),"")

In C10 control+shift+enter, not just enter, and copy down:

=IF($B10="","",INDEX($B$1:$F$1,MATCH(TRUE,ISNUMBER(1/INDEX($B$2:$F$7,MATCH($A10,$A$2:$A$7,0),0)),0)))

In D10 control+shift+enter, not just enter, and copy down:

=IF($C10="","",INDEX($B$1:$F$1,MATCH(INDEX($B2:$F2,MATCH($C10,$B$1:$F$1,0))+$B10,$B2:$F2,0)))
 
Upvote 0
So neither solution quite fits my desired result, let me clarify:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Rank[/TD]
[TD]Improvement[/TD]
[TD]May[/TD]
[TD]June[/TD]
[TD]July[/TD]
[TD]Aug[/TD]
[TD]Sept[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD]2[/TD]
[TD]100[/TD]
[TD]100[/TD]
[TD]50[/TD]
[TD]150[/TD]
[TD]175[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]Paul[/TD]
[TD]3[/TD]
[TD]75[/TD]
[TD]50[/TD]
[TD]100[/TD]
[TD]175[/TD]
[TD]250[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD]1[/TD]
[TD]125[/TD]
[TD]25[/TD]
[TD]20[/TD]
[TD]150[/TD]
[TD]100[/TD]
[TD]50[/TD]
[/TR]
</tbody>[/TABLE]


So the the key is that the order matters. I'm looking for the largest difference between a cell and the largest cell to the left of it in the same row.
 
Upvote 0
Did you look at the second example (rows 8 to 11) that I posted?
 
Upvote 0
Sorry Dave, I meant to reply. Your second solution does find the correct improvement, but it would require adding to the formula each time a new month is added. This isn't a big deal if the formula that returns the column of data in column C (as an array) so I can perform the max/large function on this array.
 
Last edited:
Upvote 0
So neither solution quite fits my desired result, let me clarify:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Rank[/TD]
[TD]Improvement[/TD]
[TD]May[/TD]
[TD]June[/TD]
[TD]July[/TD]
[TD]Aug[/TD]
[TD]Sept[/TD]
[/TR]
[TR]
[TD]Bob[/TD]
[TD]2[/TD]
[TD]100[/TD]
[TD]100[/TD]
[TD]50[/TD]
[TD]150[/TD]
[TD]175[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]Paul[/TD]
[TD]3[/TD]
[TD]75[/TD]
[TD]50[/TD]
[TD]100[/TD]
[TD]175[/TD]
[TD]250[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD]1[/TD]
[TD]125[/TD]
[TD]25[/TD]
[TD]20[/TD]
[TD]150[/TD]
[TD]100[/TD]
[TD]50[/TD]
[/TR]
</tbody>[/TABLE]


So the the key is that the order matters. I'm looking for the largest difference between a cell and the largest cell to the left of it in the same row.

Considering the data sample above shouldn't the result for Bob (Improvement) be 50 instead of 100?
150 in July - 100 in May

M.
 
Last edited:
Upvote 0
Yes it should, the edit button disappear by the time I realized I made a mistake.

Maybe this...


[TABLE="class: grid"]
<tbody>[TR]
[TD="bgcolor: #DCE6F1"][/TD]
[TD="bgcolor: #DCE6F1"]
A
[/TD]
[TD="bgcolor: #DCE6F1"]
B
[/TD]
[TD="bgcolor: #DCE6F1"]
C
[/TD]
[TD="bgcolor: #DCE6F1"]
D
[/TD]
[TD="bgcolor: #DCE6F1"]
E
[/TD]
[TD="bgcolor: #DCE6F1"]
F
[/TD]
[TD="bgcolor: #DCE6F1"]
G
[/TD]
[TD="bgcolor: #DCE6F1"]
H
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
1
[/TD]
[TD]
Name​
[/TD]
[TD]
Rank​
[/TD]
[TD]
Improvement​
[/TD]
[TD]
May​
[/TD]
[TD]
June​
[/TD]
[TD]
July​
[/TD]
[TD]
Aug​
[/TD]
[TD]
Sept​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
2
[/TD]
[TD]
Bob​
[/TD]
[TD]
2​
[/TD]
[TD]
50​
[/TD]
[TD]
100​
[/TD]
[TD]
50​
[/TD]
[TD]
150​
[/TD]
[TD]
175​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
3
[/TD]
[TD]
Paul​
[/TD]
[TD]
3​
[/TD]
[TD]
75​
[/TD]
[TD]
50​
[/TD]
[TD]
100​
[/TD]
[TD]
175​
[/TD]
[TD]
250​
[/TD]
[TD]
200​
[/TD]
[/TR]
[TR]
[TD="bgcolor: #DCE6F1"]
4
[/TD]
[TD]
Mary​
[/TD]
[TD]
1​
[/TD]
[TD]
125​
[/TD]
[TD]
25​
[/TD]
[TD]
20​
[/TD]
[TD]
150​
[/TD]
[TD]
100​
[/TD]
[TD]
50​
[/TD]
[/TR]
</tbody>[/TABLE]


Array formula in C2 copied down
=MAX(E2:Z2-SUBTOTAL(4,OFFSET(D2,,,,COLUMN(D2:Y2)-COLUMN(D2)+1)))
Ctrl+Shift+Enter

Remark: i assumed your data in the future will go as far as column Z - you can increase this range if necessary, but note that the first range (E2:Z2) should be shifted (offset) by one column relative to the second range (D2:Y2)

M.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,190
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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