Counting Unique Records Between Two Dates

Moxioron

Active Member
Joined
Mar 17, 2008
Messages
436
Office Version
  1. 2019
Hello.

I am trying to count the number of days between two dates where an employee is logged in.

B8 = Employee Name
B3 = Start Date
C3 = End Date
Detail!$A$4$:$A$17000 = Range in which employee name would appear
Detail!$Q$4$:$Q$17000 = Range in which date would appear.

This is what I am attempting to use to obtain the count:
=SUM(IF((B8=Detail!$A$4:$A$17000)*(Detail!$Q$4:$Q$17000>=B3)*(Detail!$Q$4:$Q$17000<=C3))),1/COUNTIFS(Detail!$A$4:$A$17000,$B8,$A$4$:$A$17000,$A$4:$A$17000,Detail!$Q$4:$Q$17000,">="&$B$3,Detail!$Q$4:$Q$17000,"<="&$C$3))),0)

But I'm getting a "There's a problem with this formula" error message.

I know this is an Array formula and I am selecting Cntrl/Shift/Enter.

The Filter formula is not an option unfortunately. Where am I going wrong? Thank you.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Try:

=SUM(SIGN(FREQUENCY(IF(Detail!$A$4:$A$17000=B8,IF(Detail!$Q$4:$Q$17000>=B3,IF(Detail!$Q$4:$Q$17000<=C3,Detail!$A$4:$Q$17000))),Detail!$Q$4:$Q$17000)))

with CSE.
 
Upvote 0

Forum statistics

Threads
1,215,356
Messages
6,124,471
Members
449,163
Latest member
kshealy

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