Subindexing and Marginal Differencing

dfdsiii

New Member
Joined
Sep 10, 2019
Messages
1
I have this dataset:
UserDateTime
A9/1/20198:00 AM
A9/1/201910:00 AM
A9/1/20194:00 PM
A9/1/20195:00 PM
A9/2/20198:00 AM
A9/2/20195:00 PM
B9/1/20199:00 AM
B9/1/20193:00 PM
B9/1/20195:00 PM

<tbody>
</tbody>
The first thing I want to do is add a subindex on User and Date.
UserDateTimeUser/Date Index
A9/1/20198:00 AM1
A9/1/201910:00 AM2
A9/1/20194:00 PM3
A9/1/20195:00 PM4
A9/2/20198:00 AM1
A9/2/20195:00 PM2
B9/1/20199:00 AM1
B9/1/20193:00 PM2
B9/1/20195:00 PM3

<tbody>
</tbody>
The second thing I want is a column that takes the difference between times in its row (A) and the row after it (A+1). "n/a" means I don't really care about this value. I just want the interday marginal differences.
UserDateTimeUser/Date IndexMarginal Difference
A9/1/20198:00 AM102:00:00
A9/1/201910:00 AM206:00:00
A9/1/20194:00 PM301:00:00
A9/1/20195:00 PM4n/a
A9/2/20198:00 AM109:00:00
A9/2/20195:00 PM2n/a
B9/1/20199:00 AM106:00:00
B9/1/20193:00 PM202:00:00
B9/1/20195:00 PM3n/a

<tbody>
</tbody>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi & welcome to MrExcel.
How about


Book1
ABCDE
1UserDateTime
2A09/01/20198:00 AM102:00:00
3A09/01/201910:00 AM206:00:00
4A09/01/20194:00 PM301:00:00
5A09/01/20195:00 PM4
6A09/02/20198:00 AM109:00:00
7A09/02/20195:00 PM2
8B09/01/20199:00 AM106:00:00
9B09/01/20193:00 PM202:00:00
10B09/01/20195:00 PM3
Data
Cell Formulas
RangeFormula
D2=COUNTIFS(A$2:A2,A2,B$2:B2,B2)
E2=IF(D3>D2,C3-C2,"")
 
Upvote 0

Forum statistics

Threads
1,213,495
Messages
6,113,992
Members
448,538
Latest member
alex78

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