Count consecutive dates

cristinutika

New Member
Joined
Jul 21, 2020
Messages
6
Office Version
  1. 2013
  2. 2007
Platform
  1. Windows
Hello Everyone,

I would like to ask for your support regarding how can I count any consecutive dates for each employee based on Unique report number and Destination.
Basically, I want to count how many consecutive dates a employee stayed in a same location.
Is this possible to do using an excel formula?

Thank you in advance!
 

Attachments

  • Capture.PNG
    Capture.PNG
    44.4 KB · Views: 176
A slightly long formula but worth checking a while

Book1
ABCDEF
2EmployeesReport NumberDestinationDate
3CristianaIndia01/01/2020 4.00
4CristianaIndia02/01/2020
5CristianaIndia03/01/2020
6CristianaIndia04/01/2020
7JohnRussia06/01/2020 1.00
8CristianaIndia07/01/2020 3.00
9CristianaIndia08/01/2020
10CristianaIndia09/01/2020
11PunitIndia10/01/2020 1.00
12CristianaIndia11/01/2020 2.00
13CristianaIndia12/01/2020
14IngridIndia01/01/2020 1.00
Sheet1
Cell Formulas
RangeFormula
D4:D6,D8:D13D4=D3+1
F3:F14F3=IFERROR(IF(A3=A2,"",SUM(--((IF(A3:$A$14=A3,D3:$D$14)-(D3+(ROW(D3:$D$14)-ROW(D3))))=0)*IF((ROW(D3:$D$14)-ROW(D3)+1)>MATCH(0,--(IF(A3:$A$14=A3,D3:$D$14)),0),FALSE,TRUE))),SUM(--((IF(A3:$A$14=A3,D3:$D$14)-(D3+(ROW(D3:$D$14)-ROW(D3))))=0)))
 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi @jasonb75

I figure out your answer is resulting only 1 .

Book1
ABCDEF
1EmployeesReport NumberDestinationDateJASON Answer Punit Answer
2CristianaIndia01/01/2020  4.00
3CristianaIndia02/01/2020 
4CristianaIndia03/01/2020 
5CristianaIndia04/01/20201
6JohnRussia06/01/20201 1.00
7CristianaIndia07/01/2020  3.00
8CristianaIndia08/01/2020 
9CristianaIndia09/01/20201
10PunitIndia10/01/20201 1.00
11CristianaIndia11/01/2020  2.00
12CristianaIndia12/01/20201
13IngridIndia01/01/20201 1.00
Sheet1
Cell Formulas
RangeFormula
E2:E13E2=IF(AND(A3=A2,B3=B2,C3=C2,D3=(D2+1)),"",ROW(E2)-IFERROR(MATCH(1E+100,D$1:D1),1))
F2:F13F2=IFERROR(IF(A2=A1,"",SUM(--((IF(A2:$A$13=A2,D2:$D$13)-(D2+(ROW(D2:$D$13)-ROW(D2))))=0)*IF((ROW(D2:$D$13)-ROW(D2)+1)>MATCH(0,--(IF(A2:$A$13=A2,D2:$D$13)),0),FALSE,TRUE))),SUM(--((IF(A2:$A$13=A2,D2:$D$13)-(D2+(ROW(D2:$D$13)-ROW(D2))))=0)))
D3:D5,D7:D12D3=D2+1



Hi
@cristinutika

Is that what you required.? If it is so than I suppose i missed on some criteria
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,895
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