sparkle999
New Member
- Joined
- Jan 31, 2025
- Messages
- 5
- Office Version
- 365
- Platform
- Windows
Hello, I am attempting to prepare a report for our local village hall, we use a google calendar for logging booked events and I want to analyse bookings. Having exported the data from google calendar, I have a data sheet in excel which has one row per event, with some information about the event including start and end date/timestamps, duration in hours, and other things.
I would like to compute for each event how many hours of that booking fall between 8am and 6pm (daytime), and another calculation for hours that fall between 6pm and midnight (evening).
Some events can last three days or so, many events are just for a few hours.
Can you please help me with a formula that will cater for multiple days?
I have tried an AI engine and that just went round in circles, it couldn't find a solution that actually worked!
I searched here and saw a solution based on NETWORKDAYS but having looked into that I don't care whether it's a weekend or holiday, that doesn't matter.
I tried editing the formula to use DAYS instead of NETWORKDAYS but then it only seemed to work on whole days (even when multiplying out to get hours I was getting 0 for most events), and I am looking for an answer in hours.
It was this formula: =((DAYS(A2,B2)-1)*(DAYEND-DAYSTART) +IF(DAYS(B2,B2),MEDIAN(MOD(B2,1),DAYEND,DAYSTART),DAYEND) -MEDIAN(DAYS(A2,A2)*MOD(A2,1),DAYEND,DAYSTART))
I'd be grateful if anyone could point me in the right direction.
Thanks
Nige
I would like to compute for each event how many hours of that booking fall between 8am and 6pm (daytime), and another calculation for hours that fall between 6pm and midnight (evening).
Some events can last three days or so, many events are just for a few hours.
Can you please help me with a formula that will cater for multiple days?
I have tried an AI engine and that just went round in circles, it couldn't find a solution that actually worked!
I searched here and saw a solution based on NETWORKDAYS but having looked into that I don't care whether it's a weekend or holiday, that doesn't matter.
I tried editing the formula to use DAYS instead of NETWORKDAYS but then it only seemed to work on whole days (even when multiplying out to get hours I was getting 0 for most events), and I am looking for an answer in hours.
It was this formula: =((DAYS(A2,B2)-1)*(DAYEND-DAYSTART) +IF(DAYS(B2,B2),MEDIAN(MOD(B2,1),DAYEND,DAYSTART),DAYEND) -MEDIAN(DAYS(A2,A2)*MOD(A2,1),DAYEND,DAYSTART))
I'd be grateful if anyone could point me in the right direction.
Thanks
Nige