Formula (Sumproduct?) to Lookup Rate In One Table and Multiply Against Data in Another Table

kramerica814

New Member
Joined
Jul 1, 2007
Messages
3
I couldn't find a similar solution, so I apologize if something like this has already been posted. In a nutshell, I'm trying to multiply a payroll tax rate that varies by country by salaries in an employee roster (employees tagged with country and department) and summarize the result by department.

Specifically, I have an assumptions table that has a payroll tax assumption by country and month
PT Calc Example.xlsx
ABCDEF
1Jan-21Feb-21Mar-21
2CountryCurrencyMetric
3CANCADPT %5.1%5.1%5.1%
4MEXMXNPT %3.0%3.0%3.0%
5CRCOPPT %26.5%26.5%26.5%
6POREURPT %0.0%0.0%0.0%
7GEREURPT %0.0%0.0%0.0%
8ISRILSPT %0.0%0.0%0.0%
9USUSDPT %8.5%8.0%7.5%
Expense Assumptions



This employee roster has salaries by month for hundreds of employees in various department/country combos.
PT Calc Example.xlsx
ABCDEFGHIJK
11Dept (ADP)CountryNameWage (LC)CURRStart DateEnd DateDec-20Jan-21Feb-21Mar-21
12510000-ExecutiveUSEmployee 1225,000 USD 5/25/201718,75018,75018,75018,750
13510000-ExecutiveUSEmployee 2225,000 USD 6/16/201718,75018,75018,75018,750
14510000-ExecutiveCANEmployee 3133,900 CAD 1/13/202011,1588,9278,9278,927
15520000-FinanceUSEmployee 495,000 USD 12/2/20197,9177,9177,9177,917
16520000-FinanceUSEmployee 5115,000 USD 10/20/20209,5839,5839,5839,583
17530000-PeopleUSEmployee 1095,000 USD 8/19/20197,9177,9177,9177,917
18530000-PeopleUSEmployee 11160,000 USD 10/20/202013,33313,33313,33313,333
19530000-PeopleCANEmployee 12115,000 CAD 12/15/20209,5837,6677,6677,667
20530000-PeopleCANEmployee 1360,000 CAD 4/20/2021----
21530000-PeopleMEXEmployee 143,500,002 MXN 7/20/2021----
22530000-PeopleUSEmployee 15200,000 USD 7/26/2021----
23530000-PeopleUSEmployee 16275,000 USD 7/26/2021----
24530000-PeopleUSEmployee 17170,000 USD 8/3/2021----
25540000-OperationsUSEmployee 21107,986 USD 12/2/20198,9998,9998,9998,999
26540000-OperationsUSEmployee 22112,000 USD 6/15/2021----
Headcount Roster



The output I'm looking for is simply payroll tax (salary*PT %) by department and month. So, for example, 510000-Executive would total $3,643 in January ($37,500 of US comp at 8.5% and $8,927 of Canadian comp at 5.1%)
PT Calc Example.xlsx
FGHIJK
121PT by Department
122510000-Executive
123520000-Finance
124530000-People
125540000-Operations
126550000-Information Security
127610000-Machine Learning
128620000-Software Engineering
Headcount Roster
Cell Formulas
RangeFormula
F122:F128F122=SORT(UNIQUE($A$12:$A$73))
Dynamic array formulas.


Is there a way to do this with a formula? Seems like a potential job for sumproduct, but I can't get it to work across multiple ranges. My alternative would be to calculate the PT by employee to to right and then sum, but there are a lot of other metrics that use the similar logic, so I couldn't do that for everything.

Thanks!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
N.B. I sorted the Expense Assumptions table; you could try XLookup with exact match.
My first thought was Lookup but the amounts vary by month.

SumProduct 2020.xlsm
AB
2510000-Executive3642.76
3
8a
Cell Formulas
RangeFormula
B2B2=SUMPRODUCT((A12:A26=A2)*(I12:I26)*(XLOOKUP(B12:B26,'Expense Assumptions'!A3:A9,'Expense Assumptions'!D3:D9)))
 
Upvote 0
Solution
=SUMPRODUCT((A12:A26=A2)*(I12:I26)*(XLOOKUP(B12:B26,'Expense Assumptions'!A3:A9,'Expense Assumptions'!D3:D9)))
Thanks very much! This seem to work great for this use case. I'm not that familiar with XLookup, but I think this works great if I'm matching to one variable in the assumptions table (country). Do you know of a similar strategy (like using an index(match)?) that would work with something that required a match to multiple columns? For example, I have larger assumptions tables that might have a different rate for various country and a type of expense combos to match across a similar data set. Or I may have to plan a different benefits rate for each country/department combo. I can mess around a bit, but wanted to see if that even seems doable or if I should think about reengineering the model. Really appreciate the help so far!
 
Upvote 0
Thanks for the feedback.

There are a variety of ways to access relevant data. We would require more details and relevant examples before we could comment.
 
Upvote 0
Thanks for the feedback.

There are a variety of ways to access relevant data. We would require more details and relevant examples before we could comment.
Makes sense. Here's an example of what I'm talking about. Appreciate any help.
The lookup table is like this, with different benefit % by month for each country and department combo.
PT Calc Example.xlsx
ABCDEFGHIJKLMNOP
1Jan-21Feb-21Mar-21Apr-21May-21Jun-21Jul-21Aug-21Sep-21Oct-21Nov-21Dec-21
2CountryCurrencyDepartmentMetric
3CANCAD510000-ExecutiveBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
4CANCAD520000-FinanceBenefit %3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%4.0%5.0%
5CANCAD530000-PeopleBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%
6CANCAD540000-OperationsBenefit %3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%4.0%5.0%
7CANCAD550000-Information SecurityBenefit %3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%4.0%5.0%
8CANCAD610000-Machine LearningBenefit %5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%6.0%7.0%
9CANCAD620000-Software EngineeringBenefit %5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%6.0%7.0%
10MEXMXN510000-ExecutiveBenefit %3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%
11MEXMXN520000-FinanceBenefit %2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%3.0%4.0%
12MEXMXN530000-PeopleBenefit %3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%
13MEXMXN540000-OperationsBenefit %2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%3.0%4.0%
14MEXMXN550000-Information SecurityBenefit %2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%3.0%4.0%
15MEXMXN610000-Machine LearningBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
16MEXMXN620000-Software EngineeringBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
17CRCOP510000-ExecutiveBenefit %3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%
18CRCOP520000-FinanceBenefit %2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%3.0%4.0%
19CRCOP530000-PeopleBenefit %3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%
20CRCOP540000-OperationsBenefit %2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%3.0%4.0%
21CRCOP550000-Information SecurityBenefit %2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%2.0%3.0%4.0%
22CRCOP610000-Machine LearningBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
23CRCOP620000-Software EngineeringBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
24POREUR510000-ExecutiveBenefit %5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%6.0%7.0%
25POREUR520000-FinanceBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
26POREUR530000-PeopleBenefit %5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%
27POREUR540000-OperationsBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
28POREUR550000-Information SecurityBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
29POREUR610000-Machine LearningBenefit %6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%7.0%8.0%
30POREUR620000-Software EngineeringBenefit %6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%7.0%8.0%
31GEREUR510000-ExecutiveBenefit %5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%6.0%7.0%
32GEREUR520000-FinanceBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
33GEREUR530000-PeopleBenefit %5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%
34GEREUR540000-OperationsBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
35GEREUR550000-Information SecurityBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
36GEREUR610000-Machine LearningBenefit %6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%7.0%8.0%
37GEREUR620000-Software EngineeringBenefit %6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%7.0%8.0%
38ISRILS510000-ExecutiveBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
39ISRILS520000-FinanceBenefit %3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%4.0%5.0%
40ISRILS530000-PeopleBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%
41ISRILS540000-OperationsBenefit %3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%4.0%5.0%
42ISRILS550000-Information SecurityBenefit %3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%3.0%4.0%5.0%
43ISRILS610000-Machine LearningBenefit %5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%6.0%7.0%
44ISRILS620000-Software EngineeringBenefit %5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%6.0%7.0%
45USUSD510000-ExecutiveBenefit %5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%6.0%7.0%
46USUSD520000-FinanceBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
47USUSD530000-PeopleBenefit %5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%5.0%
48USUSD540000-OperationsBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
49USUSD550000-Information SecurityBenefit %4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%4.0%5.0%6.0%
50USUSD610000-Machine LearningBenefit %6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%7.0%8.0%
51USUSD620000-Software EngineeringBenefit %6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%6.0%7.0%8.0%
Expense Assumptions (2)


The detailed data is the same:
PT Calc Example.xlsx
ABCDEFGHIJK
11Dept (ADP)CountryNameWage (LC)CURRStart DateEnd DateDec-20Jan-21Feb-21Mar-21
12510000-ExecutiveUSEmployee 1225,000 USD 5/25/201718,75018,75018,75018,750
13510000-ExecutiveUSEmployee 2225,000 USD 6/16/201718,75018,75018,75018,750
14510000-ExecutiveCANEmployee 3133,900 CAD 1/13/202011,1588,9278,9278,927
15520000-FinanceUSEmployee 495,000 USD 12/2/20197,9177,9177,9177,917
16520000-FinanceUSEmployee 5115,000 USD 10/20/20209,5839,5839,5839,583
17530000-PeopleUSEmployee 1095,000 USD 8/19/20197,9177,9177,9177,917
18530000-PeopleUSEmployee 11160,000 USD 10/20/202013,33313,33313,33313,333
19530000-PeopleCANEmployee 12115,000 CAD 12/15/20209,5837,6677,6677,667
20530000-PeopleCANEmployee 1360,000 CAD 4/20/2021----
21530000-PeopleMEXEmployee 143,500,002 MXN 7/20/2021----
22530000-PeopleUSEmployee 15200,000 USD 7/26/2021----
23530000-PeopleUSEmployee 16275,000 USD 7/26/2021----
24530000-PeopleUSEmployee 17170,000 USD 8/3/2021----
25540000-OperationsUSEmployee 21107,986 USD 12/2/20198,9998,9998,9998,999
26540000-OperationsUSEmployee 22112,000 USD 6/15/2021----
Headcount Roster


The desired output is the same. Only difference is that instead of finding the rate based on country only, the rate is based on country and department and then applied to the detailed data.
PT Calc Example.xlsx
FGHIJK
121Benefits by Department
122510000-Executive
123520000-Finance
124530000-People
125540000-Operations
126550000-Information Security
127610000-Machine Learning
128620000-Software Engineering
Headcount Roster
Cell Formulas
RangeFormula
F122:F128F122=SORT(UNIQUE($A$12:$A$73))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,948
Messages
6,175,579
Members
452,653
Latest member
craigje92

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