Forum Discussion
Count the instances of a name based on the date, into a different sheet
Greetings. I am trying to set up a spreadsheet that tracks productivity for staff using Office 365.
I am working with 2 spreadsheets in the workbook. The first sheet is named "FACILITY REQUESTS". The other is named "TOTALS".
In the Facility Requests sheet, Column B is the date we are looking at. The format is 1/1/2024. In that same sheet, Column G will be staff names. One name is "Sue".
In the Totals sheet, Column A will be a list of staff names, Columns B through M headers will be the months of the year, starting with January 2024.
I need to track how many times "Sue" appears in column G between Jan 1 & Jan 31, 2024 in Facility Requests and output that information to B2 on the Totals sheet.
We currently use Data Validation in the names column (G) and would like to keep it that way if it's possible. If not, staff is just going to have to learn how to spell their own names.
Thanks!
Hi TerriLP
If I didn't make mistake replicating your setup that should be:
in B2 then copy right & down (adjust $G$100 and $B$100 according to your actual ranges):
=COUNTIFS( 'FACILITY REQUESTS'!$G$1:$G$100, $A2, 'FACILITY REQUESTS'!$B$1:$B$100, ">=" & B$1, 'FACILITY REQUESTS'!$B$1:$B$100, "<=" & EOMONTH(B$1,0) )NB: Enter real dates (1/1/24, 1/2/24,....1/12/24) in B1:M1 then Custom Format cells to display Month names only
9 Replies
- mtarlerSilver Contributor
data validation is a very good thing.
It sounds like a Pivot Table might be exactly what you need.
your rows would be user names
then add date to columns and that should auto create months and other break downs (get rid of the ones you don't want. probably just keep years if included and months)
then add names to Values box alsohere is a screenshot example
- TerriLPCopper Contributor
Thank you both for your super fast replies. I did try both ways and both work to a degree.
Lorenzo Your way seemed to work best for me except as far as I can tell I would need a column for every day of the year. Is that right, or is there a way to put a month's worth of dates into one cell?mtarler I have only used a very simple Pivot table once and it was many years ago so I'm probably missing some important knowledge and a quick internet search wasn't super helpful. As with LZ's method, I don't see a way to display the total for the entire month rather than for each day of the month. In addition, I don't see that the table updates in real time, which is very important. I am not the person who will be gathering the information from the totals sheet so it needs to be ready whenever she needs it.
Again, I thank you both for taking the time and for being so quick about it as well.
- LorenzoSilver Contributor
I would need a column for every day of the year. Is that right, or is there a way to put a month's worth of dates into one cell?
I'm afraid I don't understand. Either it's me who don't understand your setup and/or what your process is to "fill" 'FACILITY REQUESTS' or you didn't provide the right picture 🙂 if I may
So, if what appears to be best in your contex (dynamic reporting) is doable with what I suggested, fine (there's something even more dynamic below given you run 365). Otherwise please post a couple of pictures of your actual setup and explain how Sue, Paul... record info. in 'FACILITY REQUESTS' (I suppose) and when (every day, hour...)
365 option - Same as what I shared earlier but no more copy right, down...:
where TotalFacilityRequests is a https://support.microsoft.com/en-us/office/lambda-function-bd212d27-1cd1-4321-a34a-ccbf254b8b67 function defined in Name Manager to which you pass the Year (in C2 above) you want to report on. To experience it enter 2025 in C2 in the attached file and/or add a new name(s) at the bottom of table Employee in sheet 'PARAM'
NB: I used https://support.microsoft.com/en-us/office/format-an-excel-table-6789619f-c889-495c-99c2-2f971c0e2370#:~:text=1%20Select%20any%20cell%20in%20the%20table%20from,displayed%20in%20the%20default%20table%20format.%20See%20More as they offer (amongst other benefits) dynamic ranges. That's not mandatory but recommended 🙂
- LorenzoSilver Contributor
Hi TerriLP
If I didn't make mistake replicating your setup that should be:
in B2 then copy right & down (adjust $G$100 and $B$100 according to your actual ranges):
=COUNTIFS( 'FACILITY REQUESTS'!$G$1:$G$100, $A2, 'FACILITY REQUESTS'!$B$1:$B$100, ">=" & B$1, 'FACILITY REQUESTS'!$B$1:$B$100, "<=" & EOMONTH(B$1,0) )NB: Enter real dates (1/1/24, 1/2/24,....1/12/24) in B1:M1 then Custom Format cells to display Month names only