Counting Unique Dates, between dates, with multiple criteria

hpm23

New Member
Joined
May 12, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello there,

I'm stuck trying to deliver the correct answer from the data - there's got to be easier way!

I'm wanting to count the specific number of dates that a staff member has worked, between 2 separate dates. The data I have are invoices from all dates, for all time. It has the invoice date and staff name on it.

In the image attached - I want to count the number of dates Sally worked between 8 May and 11 May. The correct output would be 3, as she worked on the 8/5, 9/5 and 10/5 but not the 11/5.

I need a formula to count this as the dataset is enormous (10 years' worth) and I only need to count specific time periods.

Any help is greatly appreciated! Thank you.
 

Attachments

  • Screenshot 2024-05-13 121037.png
    Screenshot 2024-05-13 121037.png
    54 KB · Views: 8

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
something like
=ROWS(UNIQUE(FILTER(B2:B10000,(C2:C10000>="sally")*(B2:B10000>=F4)*(B2:B10000<=G4))))

Book1
ABCDEFGH
1
27/1/24sally
37/2/24sally
47/3/247/1/247/4/24
57/1/242
67/2/24sally
77/3/24
87/1/24
97/2/24sally
107/3/24
Sheet1
Cell Formulas
RangeFormula
H5H5=ROWS(UNIQUE(FILTER(B2:B10000,(C2:C10000>="sally")*(B2:B10000>=F4)*(B2:B10000<=G4))))
 
Upvote 0
Solution
Hello there,

I'm stuck trying to deliver the correct answer from the data - there's got to be easier way!

I'm wanting to count the specific number of dates that a staff member has worked, between 2 separate dates. The data I have are invoices from all dates, for all time. It has the invoice date and staff name on it.

In the image attached - I want to count the number of dates Sally worked between 8 May and 11 May. The correct output would be 3, as she worked on the 8/5, 9/5 and 10/5 but not the 11/5.

I need a formula to count this as the dataset is enormous (10 years' worth) and I only need to count specific time periods.

Any help is greatly appreciated! Thank you.

When posting your question on the forum, you should be as clear as possible where your data is located. From your screenshot, there is no way to tell what columns we're dealing with.

Assuming that the dates are located in col. B and the staff name is in col. C. Try this:

Excel Formula:
=COUNTIFS(C1:C100,"Sally",  B1:B100,">=5/8/2024", B1:B100,"<=5/11/2024")

Adjust B100 and C100 in the formula to the actual number of rows in your worksheet.
 
Upvote 0
you are welcome
EDIT - Correction
the formula should have said = sally NOT >=
=ROWS(UNIQUE(FILTER(B2:B10000,(C2:C10000="sally")*(B2:B10000>=F4)*(B2:B10000<=G4))))
Book1
ABCDEFGH
1
27/1/24sally
37/2/24sally
47/3/247/1/247/4/24
57/1/242
67/2/24sally
77/3/24
87/1/24
97/2/24sally
107/3/24
Sheet1
Cell Formulas
RangeFormula
H5H5=ROWS(UNIQUE(FILTER(B2:B10000,(C2:C10000="sally")*(B2:B10000>=F4)*(B2:B10000<=G4))))
 
Upvote 0

Forum statistics

Threads
1,216,359
Messages
6,130,166
Members
449,562
Latest member
mthrasher16

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