Populate Name Based On Highest Amount and Date

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
951
Office Version
  1. 365
Hi,

I have the following set of data:

Excel Workbook
BCD
3DateAmountName
401-01-15250Lev
505-04-153665John
608-07-15587Suzanne
709-05-15450Jane
821-10-16120John
921-10-161350John
1021-10-16250Keith
1121-10-161470May
1221-10-16258Suzanne
1321-10-16569Suzanne
1422-10-16458Lev
1522-10-16874John
1622-10-16158Kerry
1722-10-16963Kerry
1830-10-16100May
1930-10-16254Suzanne
2030-10-16125Jane
2130-10-16365Lev
2230-10-16785Lev
Sheet2




I need to populate the following:

a) Person with highest amount for the latest date
b) Person with the highest amount by each month
c) Person with the highest amount for YTD 2016 and YTD 2015

I managed to get the highest amount for the latest date with the following formula but beyond that I am stuck.Appreciate all the help.

{=MAX(IF(Sheet2!B4:B22=D3,Sheet2!C4:C22))}
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
That is a tall order...

[TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD]
A​
[/TD]
[TD]
B​
[/TD]
[TD]
C​
[/TD]
[TD]
D​
[/TD]
[TD]
E​
[/TD]
[TD]
F​
[/TD]
[TD]
G​
[/TD]
[TD]
H​
[/TD]
[TD]
I​
[/TD]
[/TR]
[TR]
[TD]
1​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
5​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
2​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]max amt latest date[/TD]
[TD]month[/TD]
[TD]name(s)[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
3​
[/TD]
[TD]Date[/TD]
[TD]Amount[/TD]
[TD]Name[/TD]
[TD][/TD]
[TD]
10/30/2016​
[/TD]
[TD]
1/1/2015
[/TD]
[TD]Lev[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
4​
[/TD]
[TD]
1/1/2015
[/TD]
[TD]
250
[/TD]
[TD]
Lev
[/TD]
[TD][/TD]
[TD]
785​
[/TD]
[TD]
4/1/2015
[/TD]
[TD]John[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
5​
[/TD]
[TD]
4/5/2015
[/TD]
[TD]
3665
[/TD]
[TD]
John
[/TD]
[TD][/TD]
[TD]name(s)[/TD]
[TD]
5/1/2015
[/TD]
[TD]Jane[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
6​
[/TD]
[TD]
7/8/2015
[/TD]
[TD]
587
[/TD]
[TD]
Suzanne
[/TD]
[TD][/TD]
[TD]Linda[/TD]
[TD]
7/1/2015
[/TD]
[TD]Suzanne[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
7​
[/TD]
[TD]
5/9/2015
[/TD]
[TD]
450
[/TD]
[TD]
Jane
[/TD]
[TD][/TD]
[TD]Lev[/TD]
[TD]
10/1/2016
[/TD]
[TD]Rob[/TD]
[TD]May[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
8​
[/TD]
[TD]
10/20/2016​
[/TD]
[TD]
1470
[/TD]
[TD]
Rob
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
9​
[/TD]
[TD]
10/21/2016
[/TD]
[TD]
120
[/TD]
[TD]
John
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
10​
[/TD]
[TD]
10/21/2016
[/TD]
[TD]
1350
[/TD]
[TD]
John
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
11​
[/TD]
[TD]
10/21/2016
[/TD]
[TD]
250
[/TD]
[TD]
Keith
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
12​
[/TD]
[TD]
10/21/2016
[/TD]
[TD]
1470
[/TD]
[TD]
May
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
13​
[/TD]
[TD]
10/21/2016
[/TD]
[TD]
258
[/TD]
[TD]
Suzanne
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
14​
[/TD]
[TD]
10/21/2016
[/TD]
[TD]
569
[/TD]
[TD]
Suzanne
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
15​
[/TD]
[TD]
10/22/2016
[/TD]
[TD]
458
[/TD]
[TD]
Lev
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
16​
[/TD]
[TD]
10/22/2016
[/TD]
[TD]
874
[/TD]
[TD]
John
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
17​
[/TD]
[TD]
10/22/2016
[/TD]
[TD]
158
[/TD]
[TD]
Kerry
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
18​
[/TD]
[TD]
10/22/2016
[/TD]
[TD]
963
[/TD]
[TD]
Kerry
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
19​
[/TD]
[TD]
10/30/2016
[/TD]
[TD]
100
[/TD]
[TD]
May
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
20​
[/TD]
[TD]
10/30/2016
[/TD]
[TD]
254
[/TD]
[TD]
Suzanne
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
21​
[/TD]
[TD]
10/30/2016
[/TD]
[TD]
125
[/TD]
[TD]
Jane
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
22​
[/TD]
[TD]
10/30/2016
[/TD]
[TD]
785
[/TD]
[TD]
Linda
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
23​
[/TD]
[TD]
10/30/2016
[/TD]
[TD]
365
[/TD]
[TD]
Lev
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
24​
[/TD]
[TD]
10/30/2016
[/TD]
[TD]
785
[/TD]
[TD]
Lev
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


(a) In E3 just enter:

=MAX($A$4:$A$24)

In E4 control+shift+enter, not just enter:

=MAX(IF($A$4:$A$24=E3,$B$4:$B$24))

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

=IFERROR(INDEX($C$4:$C$24,SMALL(IF($B$4:$B$24=E$4,ROW($C$4:$C$24)-ROW($C$4)+1),ROWS($E$6:E6))),"")

(b) In F1 control+shift+enter:

=SUM(IF(FREQUENCY(IF(ISNUMBER($A$4:$A$24),$A$4:$A$24-DAY($A$4:$A$24)+1),$A$4:$A$24-DAY($A$4:$A$24)+1),1))

In F3 control+shift+enter and copy down:

=IF(ROWS(F$3:F3)>$F$1,"",MIN(IF(ISNA(MATCH($A$4:$A$24-DAY($A$4:$A$24)+1,$F$2:F2,0)),$A$4:$A$24-DAY($A$4:$A$24)+1)))

In G3 control+shift+enter, copy across, and down:

=IFERROR(INDEX($C$4:$C$24,SMALL(IF($A$4:$A$24-DAY($A$4:$A$24)+1=$F3,IF($B$4:$B$24=MAX(IF($A$4:$A$24-DAY($A$4:$A$24)+1=$F3,$B$4:$B$24)),ROW($C$4:$C$24)-ROW($C$4)+1)),COLUMNS($G3:G3))),"")

(c) YTD names I leave to you...
 
Upvote 0
Hi Aladin,

Thank you so much for your time and patience. I used the formula but I am getting as follows for (b):

Excel Workbook
ABCDEFG
2****max amt latest datemonthname(s)
3DateAmountName*30-10-1610
401-01-15250Lev*785**
505-04-153665John****
608-07-15587Suzanne*Lev**
709-05-15450Jane****
821-10-16120John****
921-10-161350John****
1021-10-16250Keith****
1121-10-161470May****
1221-10-16258Suzanne****
1321-10-16569Suzanne****
1422-10-16458Lev****
1522-10-16874John****
1622-10-16158Kerry****
1722-10-16963Kerry****
1830-10-16100May****
1930-10-16254Suzanne****
2030-10-16125Jane****
2130-10-16365Lev****
2230-10-16785Lev****
Sheet2



For (c), is there suppose to be a formula in cell H7?
 
Upvote 0

Forum statistics

Threads
1,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

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