I am trying to find a way of counting the total number of days medical devices were in-situ for a fairly large dataset.
The worksheet has a few thousand rows. Column A – unique identifier for patient; column B – date inserted (Aug 02 – Aug 13); column C – date removed or audit date. There is no missing data, all rows have both dates. Some devices in for few days or weeks, some for up to 7 years.
I want to count each 12 month period (starting 1 Aug 02) the total “device days” for that year.
(e.g. if device inserted 1 Feb 03 and removed 1 Apr 03, in year period starting 1 Aug 02 would have been in for 59 days. Another device inserted on same day and not removed until 9 Sept 05, would for first period (01/08/02- 31/07/03) 181 days, second period 366 days, third 365 days and fourth (01/08/05-31/07/06) 39 days). Therefore for the two rows, the first period total would be 240 days (59+181).
I’m sure there is a simple way of doing this, but I can’t find it. Thank you for your help. Nick
Bookmarks