Showing highest selling product based on criteria

creative999

Board Regular
Joined
Jul 7, 2021
Messages
116
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
Hi

Trying to find:

Highest selling product (Y:Y) based on total sales (K:K)
And criteria (L:L and S:S).

The formula below works if theres a product that matches the L:L and S:S criteria. If theres no matching product from Y:Y, I was expecting it to return a ‘--’ value, instead it still returns a product name.

Any suggestions?

=IFERROR(LET(u,UNIQUE(sheet1!$Y2:$Y20000), INDEX(SORT(CHOOSE({1,2},u,SUMIFS(sheet1!$K2:$K20000, sheet1!$Y2:$Y20000,u ,sheet1!$L2:$L20000,"RESALE", sheet1!$S2:$S20000,"YES")),2,-1),SEQUENCE(1),{1})),"--")
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
How about
Excel Formula:
=LET(u,UNIQUE(Sheet1!$Y2:$Y20000), s,SORT(HSTACK(u,SUMIFS(Sheet1!$K2:$K20000, Sheet1!$Y2:$Y20000,u,Sheet1!$L2:$L20000,"RESALE", Sheet1!$S2:$S20000,"YES")),2,-1),TAKE(FILTER(s,INDEX(s,,2)>0,"--"),1,1))
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,225,738
Messages
6,186,736
Members
453,369
Latest member
juliewar

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