I have got a very strange problem. I have lot of data with columns of dates, ID column etc. I want to take the difference of time of 2 dates (where dates are reported as 7/16/2017 18:42) in both columns. At first instance, it looks easy to take simple difference but problem here is ID column. In ID column, there are lot of IDs where IDs are duplicate also. So below are the conditions:
- Take difference of date and time where first row of ID. Like A2-B2
- When same ID comes again, take the difference of Date then difference would be like B2-A3. But ID should be from same group.
Below are the rows:
ID Date 1 Date 2
5AB80D3A 7/10/2017 14:16 7/14/2017 11:38
5AB80D3A 7/14/2017 11:38 7/14/2017 12:48
5AB80D3A 7/14/2017 13:00 7/14/2017 19:09
5AB80D3A 7/14/2017 19:09 7/14/2017 21:09
5AB80D 7/14/2017 19:09 7/14/2017 21:09
5AB80D 7/14/2017 19:09 7/14/2017 21:09
5AB80A 7/14/2017 19:09 7/14/2017 21:09
If this can be done in excel/SQL, it will be helpful. Thanks in advance for your guidance.