Counting Consecutive Days

Prognosis

New Member
Joined
Dec 5, 2014
Messages
3
Good afternoon everyone,

I have a set of data that has ID and Date. I need to create a new column with Days Worked that is a formula to solve how many consecutive days someone works. If you want to go 1 step above that, we need to be sure ID's match. Data will be sorted by ID then by Date (oldest to new).

Any ideas?

IDDateDays Worked
A
04-Jul-15

<tbody>
</tbody>
1
A
07-Jul-15

<tbody>
</tbody>
1
A
09-Jul-15

<tbody>
</tbody>
1
A
10-Jul-15

<tbody>
</tbody>
2
A
11-Jul-15

<tbody>
</tbody>
3
A
12-Jul-15

<tbody>
</tbody>
4
A
13-Jul-15

<tbody>
</tbody>
5
A
14-Jul-15

<tbody>
</tbody>
6
A
16-Jul-15

<tbody>
</tbody>
1

<tbody>
</tbody>

Thanks!

*edit - wow that table does not look like i expect. Sorry about that.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
I've come up with something along these lines: (dates are in column B)

=1+IF(B6=B5+1,1,0)+IF(B6=B4+2,1,0)

but there as to be a better way! I dont know how many consecutive days there could be so i wouldnt want to write this out for 8 days and someone work a 9th day and it not be recognized in the equation.

Thoughts?
 
Upvote 0
Perhaps this:

=IF(B2-B1=1,C1+1,1)

This is intended for data starting in row 2, as row 1 will be blank or headers. Can't start it in row 1, because there is no row 0 to reference above it. Copy down as far as you need.
 
Upvote 0

Forum statistics

Threads
1,216,028
Messages
6,128,399
Members
449,447
Latest member
M V Arun

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