Lookup Dept of Employee from Another Sheet and Add that Total to the department total

ja189704

New Member
Joined
Jan 25, 2022
Messages
5
Office Version
  1. 2021
Platform
  1. Windows
I have a two worksheets:
  1. COSTS. It has a list of cost by employee ID (EQUITYHOLDERCODE).
  2. EMP DATE. A list that has employees with their department number, which has leading zeroes.
On the costs tab I want to lookup the employee department and than add the CURRENTEXPENSE (Column K tab COSTS) to that department total.

For EQUITYHOLDERCODE that is alpha I want it to just give me a total for all alpha.

Then I want it to put the details by department on third tab (but the department in the list it the # and name, I just want the 9 digit #), Desired Result. And the total from the CURRENTEXPENSE total to the be offset at the end.

I've attached a google sheet link. If someone could tell me what steps I need to take. I can use VBA to take the left 9 of the department into a new column and then vlookup on the new data. I know that's my 1st grade knowledge of VBA. I suspect I need to use some sort of array.......

Any help to point me in the right direction is appreciated.

Thanks.

SBC Marco.xlsm
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi, I don't know if these are any good to you, on the Desired Results sheet in A2 type "=SORT(UNIQUE(FILTER(COSTS!N:N,COSTS!N:N<>"")))", that will give you a sorted dynamic list of your employee departments & in B2 type "=IF(A1="ALPHA NOT NUMERIC",SUM($B$2:OFFSET($B$2,COUNT(ROW($A$2#))-1,0)),SUMIF(COSTS!N:N,A2,COSTS!K:K))" & copy it down, this will give you all your department totals with a grand total below.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

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