Count consecutive days and gaps between days

Vintage79

Board Regular
Joined
May 29, 2007
Messages
187
Office Version
  1. 2019
Platform
  1. Windows
Hello all,

I have an input sheet as follows:
Work Sheet.xlsx
BCD
2DayDateWorking
3Mon05-Jan-16W
4Tue06-Jan-16W
5Wed07-Jan-16W
6Thu08-Jan-16W
7Fri09-Jan-16
8Sat10-Jan-16
9Sun11-Jan-16
10Mon12-Jan-16
11Tue13-Jan-16W
12Wed14-Jan-16W
13Thu15-Jan-16W
14Fri16-Jan-16W
15Sat17-Jan-16W
16Sun18-Jan-16W
17Mon19-Jan-16W
18Tue20-Jan-16
19Wed21-Jan-16
20Thu22-Jan-16
21Fri23-Jan-16W
22Sat24-Jan-16W
23Sun25-Jan-16
24Mon26-Jan-16
25Tue27-Jan-16
26Wed28-Jan-16
27Thu29-Jan-16
28Fri30-Jan-16W
29Sat31-Jan-16W
30Sun01-Feb-16W
31Mon02-Feb-16W
32Tue03-Feb-16W
33Wed04-Feb-16
34Thu05-Feb-16
35Fri06-Feb-16
36Sat07-Feb-16
37Sun08-Feb-16
Sheet1

This allows me to put a 'W' by any day that I worked. Then I have a summary sheet:

Work Sheet.xlsx
BCDEFGH
2Work streaksTime between streaks
3StartFinishDurationStartFinishDuration
405-Jan-1608-Jan-16409-Jan-1612-Jan-164
513-Jan-1619-Jan-16720-Jan-1622-Jan-163
623-Jan-1624-Jan-16225-Jan-1629-Jan-165
730-Jan-1603-Feb-16504-Feb-16  
Summary
Cell Formulas
RangeFormula
F4:F7F4=IF(C4="","",C4+1)
G4:G7G4=IF(B5="","",B5-1)
H4:H7H4=IF(G4="","",((DAYS(G4,F4)+1)))
D4:D7D4=IF(B4="","",((DAYS(C4,B4)+1)))


At the moment it is set up so that I have to manually enter the dates I started/stopped working, and then the time between work is automated. But is it possible, without using VBA, to use a formula that can enter the start/end dates on the summary page?

Thank you for any help!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Try:

Cell Formulas
RangeFormula
B4:B8B4=IFERROR(AGGREGATE(15,6,Sheet1!$C$3:$C$100/(Sheet1!$D$2:$D$99<>"W")/(Sheet1!$D$3:$D$100="W"),ROWS(B$4:B4)),"")
C4:C8C4=IF(B4="","",MINIFS(Sheet1!$C$3:$C$100,Sheet1!$C$3:$C$100,">"&B4,Sheet1!$D$3:$D$100,"<>W")-1)
D4:D8D4=IF(B4="","",C4-B4+1)
E4:E8E4=IFERROR(AGGREGATE(15,6,Sheet1!$C$3:$C$100/(Sheet1!$D$2:$D$99="W")/(Sheet1!$D$3:$D$100<>"W"),ROWS(E$4:E4)),"")
F4:F8F4=IFERROR(IF(E4="","",1/(1/MINIFS(Sheet1!$C$3:$C$100,Sheet1!$C$3:$C$100,">"&E4,Sheet1!$D$3:$D$100,"W"))-1),"")
G4:G8G4=IF(F4="","",F4-E4+1)
 
Upvote 0
Solution
This is amazing!!! Thank you so much Eric - I really appreciate it.
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

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