joleigh94

New Member
Joined
May 13, 2020
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi,

This is the first time I've posted here so apologies if any of this is incorrect.

I have a list of products ordered by week with their volume.

I would like to select the top ten products by week. I have found and used the formula which gets the top ten, but I am struggling to do it by week.

Formula I used to get top 10: =INDEX(C$2:$C$28,MATCH(1,INDEX(($D$2:$D$28=LARGE($D$2:$D$28,ROWS(I$2:I4)))*(COUNTIF(I$2:I4,$C$2:$C$28)=0),),0))

One of the ways I have tried to do it by category: =INDEX(C$2:$C$28,MATCH(1,($I$2=$A$2:$A$28)*(INDEX(($D$2:$D$28=LARGE($D$2:$D$28,ROWS(I$2:I2)))*(COUNTIF(I$2:I2,$C$2:$C$28)=0),)),0))

If this is not possible, I will have to do this in two steps by first creating a table of products by week, then selecting the largest.

Any help is greatly appreciated :)

Thanks,
Jo
 

Attachments

  • MicrosoftTeams-image.png
    MicrosoftTeams-image.png
    183.1 KB · Views: 18
Last edited by a moderator:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
How about either of these

+Fluff New.xlsm
ABCDEFGHIJ
1weekWardPopulation
2202020Sopwell95202020
3202020Ashley70SopwellSopwell
4202020Watling53AshleyAshley
5202020Batchwood41WatlingWatling
6202020Ashley31BatchwoodBatchwood
7202020Verulam24AshleyAshley
8202020Ashley21VerulamVerulam
9202020Welham Green and Hatfield South21AshleyAshley
10202020St Stephen21Welham Green and Hatfield SouthWelham Green and Hatfield South
11202020Clarence19St StephenSt Stephen
12202020Hatfield Central15ClarenceClarence
13202020Sandridge12 
14202020Marshalswick North12 
15202020Wheathampstead11 
16202020Redbourn8 
17202020Redbourn8 
18202020Hatfield Central7 
19202020Park Street6 
20202020London Colney4
21202020St Peters3
22202020Hatfield Villages2
23202020Colney Heath1
24202020Wheathampstead1
25212020Harpenden South123
26212020Harpenden East80
27212020Peartree63
28212020Harpenden West49
29212020Harpenden North47
30212020Welwyn West47
31212020Harpenden West33
32212020Harpenden East30
33212020Redbourn14
34212020Welwyn West9
35212020Welwyn West2
Master
Cell Formulas
RangeFormula
I3:I12I3=FILTER(C2:C35,(A2:A35=I2)*(D2:D35>=AGGREGATE(14,6,D2:D35/(A2:A35=I2),10)))
J3:J19J3=IFERROR(INDEX($C$2:$C$35,AGGREGATE(15,6,(ROW($C$2:$C$35)-ROW($C$2)+1)/(($A$2:$A$35=$I$2)*($D$2:$D$35>=AGGREGATE(14,6,$D$2:$D$35/($A$2:$A$35=$I$2),10))),ROWS(I$3:I3))),"")
Dynamic array formulas.
 
Upvote 0
Hi,

Thank you for getting back to me so quickly.

Unfortunately, I don't have the FILTER function. I tried to download it but I'm unable to without admin authorisation.
 
Upvote 0
i just realised this is two separate suggestions.. i'll try the second one :)
 
Upvote 0
that worked great - thank you so much! for some reason, one of the 17 weeks doesn't want to work :(

if you dont mind me asking, what does the AGGREGATE(15,6.... and AGGREGATE(14,6...... do/mean?

thank you so much again!
 
Upvote 0
This part
AGGREGATE(14,6,$D$2:$D$35/($A$2:$A$35=$I$2),10)
Is like the Large function & is finding the 10th largest value in col D where col A matches the value in I2.
And the Aggregate(15,6 is acting like the small function & is finding the 1st row, then 2nd row etc where col A matches I2 & col D is one of the 10 largest numbers.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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