Unique count with a sumifs

EmmaTM

Board Regular
Joined
Jan 5, 2022
Messages
104
Office Version
  1. 365
Platform
  1. Windows
Hi,
I have a table of staff data and I am currently doing this sumifs calculation to pull over hours worked (column R) using departments and cost centres (columns K, Q & Y) there may be multiple lines for 1 worker:
=SUMIFS(Data!$R:$R,Data!$K:$K,'370'!$C$1,Data!$Q:$Q,'370'!O9,Data!$Y:$Y,'370'!C9)
In another cell I want to count within this data how many workers there are - I have a unique personnel code in column L

Thank you
Emma
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Do you have a header in row 1 of column L? What row does the data start in?

Something like
Excel Formula:
=UNIQUE(FILTER($L:$L, ($L:$L<>"")*($L:$L<>"Unique Personnel Code"))
 
Upvote 0
Hi Jeff,
Yes header in L is Personnel_Ref
Data will start in row 2
 
Upvote 0
Do I change this "Unique Personnel Code" to "Personnel_Ref"?

This is how my summary looks currently (I have changed my sumifs from when I first posted), I am looking for the unique count to go into column D where highlighted green.
The personnel code is on the data tab in column L, I think I need to incorporate the sumifs so that I get the correct count
Hope thats more helpful!

1726171577743.png
 
Upvote 0
I don't understand what you are summarizing. What is the data in green?

Seeing the summary doesn't help much. I need to see the source data.
 
Upvote 0
Good morning,
This is my data sheet:
1726217089722.png


This is my summary:
1726217332480.png

I am using sumifs to pull in the hours worked (R) so item 1 on the summary for a Mod 3B4 (Y) working week days (Z) using the relevant PO number (K)
What I now need to do is count how many workers are included in that calculation by using column L Personell ref - this data needs to go into the green cells on my summary.

Please let me know if yu need me to clarify anything further?
Thank you
 
Upvote 0
It is very difficult to work with just partial screenshots here. I can't see the cells referenced in your SUMIFS formula and you have not included row and column headers so I can't see what cell is what in your summary sheet.

The best I can do is make an educated guess based on your SUMIFS formula and what I see on your data sheet. Please try this for a count of employees included in the sum of hours:

Excel Formula:
=COUNTA(UNIQUE(FILTER(Data!$L:$L,(Data!$K:$K='370'!$C$1)*(Data!$Q:$Q='370'!O9)*(Data!$Y:$Y='370'!C9))))
 
Upvote 0
Test.xlsx
E
37
4200023896

Test.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
1Employer_RefClient_RefClient_NameDocTypeTax_YearTax_PeriodInvoice_NumberInvoice_DateTimesheet_NumberTimesheet_DatePurchase_OrderPersonnel_RefFirst_ForenameSurnameJob_TitleNoValDescriptionHoursBill_RateLine_Bill_AmountInfinisIdInfo1Info2Info3Info4Info5Employment_TypeAssignment_Ref
2INV20241750151201/08/2024GEN00058538426/07/20244200023900M84065CAFunctional TesterTravel655330119949Kilmarnock63428Mod 3B4Week Day 06:00 Mon - 17:59 FriCM724481,620.00Timesheet 501512 - WK17Included on PO4200023900 Worksheet
3INV20241850205908/08/2024GEN00058821602/08/20244200023900M84065CAFunctional TesterTravel655330120955Kilmarnock63428Mod 3B4Week Day 06:00 Mon - 17:59 FriCM724481,620.00Timesheet 502059 - WK18Included on PO4200023900 Worksheet
4INV20241850205908/08/2024GEN00058821602/08/20244200023900M84065CAFunctional TesterHourly - Weekend Day or Night11.565747.5120956Kilmarnock63428Mod 3B4Weekend 18:00 Fri - 05:59 MonCM724481,620.00Timesheet 502059 - WK18Included on PO4200023900 Worksheet
5INV20241850205908/08/2024GEN00058828802/08/20244200023900M84065CAFunctional TesterExpenses1150150120957Kilmarnock63428Mod 3B4ExpensesCM724481,620.00Timesheet 502059 - WK18Included on PO4200023900 Worksheet
6INV20242250396105/09/2024GEN00059768709/08/20244200023941M27146CATester In ChargeHourly - Weekend Day or Night11.5901035124523Elderslie & Glenarnock62683TICWeekend 18:00 Fri - 05:59 MonCM726481,020.00Timesheet 503961 - WK22Included on PO4200023941 Worksheet
7INV20242350444512/09/2024GEN00059907702/08/20244200023896M27146CATester In ChargeHourly - Weekend Day or Night11.5901035125492Elderslie & Glenarnock62683TICWeekend 18:00 Fri - 05:59 MonCM724521,020.00Timesheet 504445 - WK23Included on PO4200023896 Worksheet
Data
 
Upvote 0
Sorry I am really struggling to get my workbooks uploaded.
Test.xlsx
P
23
4200023896
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,203
Members
452,617
Latest member
Narendra Babu D

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