Sumifs using unique and filter functions

Tarek78

New Member
Joined
Feb 21, 2021
Messages
46
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone,

I have attached a spreadsheet and highlighted in yellow the column K I would need to be filled with a formula (spill formula only so that it is completely automated).

Column I and J: This is a spill formula using Unique, Filter and Choose function.
Column K: I would need a spill formula to get the sum of the sales generated by each rep for each region covered


I tried a lot to work on it but cannot find an answer :(

Thanks for your help
 

Attachments

  • unique sumif.PNG
    unique sumif.PNG
    66.6 KB · Views: 387
I would have thought this would give you the same result but with the pivot doing most of the work and giving you added capabilities.

PS: I have stacked the Filter function on top of the Pivot's output.

20220605 Filter Unique Sort or Pivot Tarek78.xlsx
ABCDEFGHIJK
1IRIS CODEProjectCommercial ContractSalesIRIS CODECommercial ContractProject Sales
2ACCOFR.1001TARS1000SNCFMISTRALFR.040025000
3ACCOFR.1002Not Assigned500SNCFNot AssignedFR.11113000
4ACCOFR.1001TARS2000RATPRAEFR.112220000
5ACCOFR.1003FRI4000ACCOFRIFR.10034000
6SNCFFR.0400MISTRAL10000ACCOTARSFR.10013000
7SNCFFR.0400MISTRAL15000ACCONot AssignedFR.1002500
8SNCFFR.1111Not Assigned3000
9RATPFR.1122RAE20000
10
11Stacked on top of Pivot Columns
12
13IRIS CODECommercial ContractProject Sales
14SNCFMISTRALFR.040025000
15SNCFNot AssignedFR.11113000
16RATPRAEFR.112220000
17ACCOFRIFR.10034000
18ACCOTARSFR.10013000
19ACCONot AssignedFR.1002500
20
Data
Cell Formulas
RangeFormula
A13:D19A13=FILTER($G:$J,$G:$G<>"")
Dynamic array formulas.
 
Upvote 0

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi Alex, I think you are right. It is much easier to build a pivot, sort it, and then use a filter function based on this pivot.

I would like to thank you all.
 
Upvote 0
Sure, a variation of that formula would work:

Book1
ABCDEF
1Sales RepRegionSales
2SimonEast1000
3SimonWest2000
4SimonNorth1000RepTotal Sales
5TimSouth4000Tim10000
6TimEast5000Nick5000
7TimWest1000Simon4000
8NickSouth4000
9NickWest1000
Sheet5
Cell Formulas
RangeFormula
E5:F7E5=LET(r,UNIQUE(Table1_2[Sales Rep]),SORT(CHOOSE({1,2},r,SUMIFS(Table1_2[Sales],Table1_2[Sales Rep],r)),2,-1))
Dynamic array formulas.
Hi there - if the table had a fourth column, let's say 'Returns', can the formula be modified to include that one as well?
 
Upvote 0
Hi there - if the table had a fourth column, let's say 'Returns', can the formula be modified to include that one as well?
Like this?

Book1
ABCDEFGH
1Sales RepRegionSalesReturns
2SimonEast100010
3SimonWest200020
4SimonNorth100030RepTotal SalesReturns
5TimSouth400040Tim10000150
6TimEast500050Nick5000150
7TimWest100060Simon400060
8NickSouth400070
9NickWest100080
Sheet1
Cell Formulas
RangeFormula
F5:H7F5=LET(r,UNIQUE(Table1_2[Sales Rep]),SORT(CHOOSE({1,2,3},r,SUMIFS(Table1_2[Sales],Table1_2[Sales Rep],r),SUMIFS(Table1_2[Returns],Table1_2[Sales Rep],r)),2,-1))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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