sav248

New Member
Joined
Feb 28, 2014
Messages
3
I am looking for a single formula that will aggregate data for a parent group with a one to many relationship. Imagine I have sales by employee and I have an employee to group mapping table. My goal is to create a table with sales by group without mapping the group to the sales by employee table.

Sales By Employee

EmployeeSales
Bob10
Jeff20
Tom30
Sarah40
Jane50

<tbody>
</tbody>

Employee to Group Map

GroupSalesperson
WidgetsBob
WidgetsSarah
WidgetsJane
ClocksJeff
ClocksTom

<tbody>
</tbody>

Sales By Group

GroupSales
Widgets100
Clocks50

<tbody>
</tbody>

Is there a single formula that I could put into the Sales column of Sales By Group that would return this result without having to add a third column to the Sales by Employee table?

I need a lookup function that would return the array of employees based on group then sum sales based on this. Unfortunately it doesn't seem possible to nest an array function within a function.

I could do this with a UDF but my employer has an extreme aversion to VBA.

Any different approaches? Many thanks. This is my first post on an excel msg board so forgive me if it is unclear.
 

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"
Maybe...


A
B
C
D
E
F
G
H
1
Employee​
Sales​
Group​
Salesperson​
Group​
Sales​
2
Bob​
10​
Widgets​
Bob​
Widgets​
100​
3
Jeff​
20​
Widgets​
Sarah​
Clocks​
50​
4
Tom​
30​
Widgets​
Jane​
5
Sarah​
40​
Clocks​
Jeff​
6
Jane​
50​
Clocks​
Tom​

Formula in H2 copied down
=SUMPRODUCT(SUMIF($A$2:$A$6,$E$2:$E$6,$B$2:$B$6),--($D$2:$D$6=G2))

Hope this helps

M.
 
Upvote 0
You are welcome and thanks for the feedback.

M,

Is there any way to extend this to multiple criterion? In cell L2 I would like all cash sales for the widget team, in L3 cash sales for the clock team.

Thank you!
ABCDEFGHIJKL
1EmployeeSalesPayment TypeGroupSalespersonPayment TypeCashOrCreditGroupCash Sales
2Bob10Trade CreditWidgetsBobTrade CreditCreditWidgets
3Jeff20CODWidgetsSarahCODCashClocks
4Tom30CashWidgetsJaneCashCash
5Sarah40Credit CardClocksJeffCredit CardCredit
6Jane50Past DueClocksTomPast DueCredit
7Bob50COD
8Jane50Credit Card
9Jeff20Cash

<tbody>
</tbody>
 
Upvote 0
Try this in L2 (copy down to L3)

=SUMPRODUCT(--ISNUMBER(MATCH(K2&"|"&$A$2:$A$9,$E$2:$E$6&"|"&$F$2:$F$6,0)),--ISNUMBER(MATCH($C$2:$C$9&"|"&"Cash",$H$2:$H$6&"|"&$I$2:$I$6,0)),$B$2:$B$9)

M.
 
Upvote 0

Forum statistics

Threads
1,215,467
Messages
6,124,984
Members
449,201
Latest member
Lunzwe73

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