• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 55
  • Last Modified:

group by months

i have attached a sample workbook.I work like to have a formula/vba that would extract the top 20 totals  for each group.
thanks
top20.xlsb
0
Svgmassive
Asked:
Svgmassive
  • 2
1 Solution
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
Hello,

put the numbers from 1 to 20 into cells E2 to E21. Copy down so you have these 20 numbers for each group.

Put the dates next to that, starting in F2. Then you can use this array formula in G2

=LARGE(IF($A$1:$A$773=F2,$C$1:$C$773,0),E2)

You need to confirm with Ctrl-Shift-Enter. Then copy down.

screenshot
cheers, teylyn
0
 
yo_beeDirector of ITCommented:
You can leverage Pivot Tables.
I have attached your data in a pivot table. sheet 2

top20.xlsb
0
 
Ingeborg Hawighorst (Microsoft MVP / EE MVE)Microsoft MVP ExcelCommented:
yo bee, while a pivot table can be filtered to show top x values, the one you posted does not apply this technique. Where are the top 20? A pivot will not work here, I think, because it will also add the data from the same day, so the 20 highest values of the month cannot be shown.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now