Counting People per Day From a List With Start & End Dates

Bruce Montemayor

New Member
Joined
May 21, 2017
Messages
1
Hello All, this has been gnawing at me and I just can't get it to work.

I have one table with the following fields:
-Name
-Event
-Specialty
-Start Date
-End Date

I would like to have a table of dates, let's say one year, and I would like to have a column counting the number of people per day.

So for January 1, how many people are there where January 1 falls between their start and end date?

I would like to be able to slice or aggregate by event and/or specialty.

Essentially, I want to be able to show a grand total for each day, and as another view, number of people per specialty per day. Then another pivot, the number of people per specialty per event.

I do understand that once the measure is built, I can simply place the other fields when and where needed. But the measure is my Bigfoot/Loch Ness Monster/(name your elusive creature).

Any help will be greatly appreciated. Thanks Much!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
You have 2 date columns in the data table, so I suggest not using any relationships. Besides if you create relationships you will likely have problems when time period analysis cross year end. Instead you can apply virtual relationship using filter functions. Something like this (not tested)

Code:
calculate(countrows(dataTable),
   Filter(dataTable,dataTable[from date] <=min(calendar[date]) && dataTable[to date] >= max(calendar[date])))

i guess this will only count those that are there at the start and the end.
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,897
Members
449,097
Latest member
dbomb1414

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