Increment Cell Number based on Date & Time

rbobcat1

New Member
Joined
Dec 19, 2011
Messages
19
Office Version
  1. 365
Platform
  1. Windows
I have tried everything out there from google search to youtube videos but cannot find anything to help me get to the below example. Does anyone have a formula that would work?
The top set is based on the date and time in column b.
The bottoms set is based on the date in column b and the time in column c.
[TABLE="width: 309"]
<tbody>[TR]
[TD]Unique_id[/TD]
[TD]date[/TD]
[TD]date_1[/TD]
[/TR]
[TR]
[TD]20180201-001[/TD]
[TD]2/1/2018 7:53[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20180201-002[/TD]
[TD]2/1/2018 8:53[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20180201-003[/TD]
[TD]2/1/2018 9:53[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20180202-001[/TD]
[TD]2/2/2018 7:53[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20180202-002[/TD]
[TD]2/2/2018 8:53[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20180202-003[/TD]
[TD]2/2/2018 9:53[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20180201-001[/TD]
[TD]2/1/2018[/TD]
[TD]7:53 AM[/TD]
[/TR]
[TR]
[TD]20180201-002[/TD]
[TD]2/1/2018[/TD]
[TD]8:53 AM[/TD]
[/TR]
[TR]
[TD]20180201-003[/TD]
[TD]2/1/2018[/TD]
[TD]9:53 AM[/TD]
[/TR]
[TR]
[TD]20180202-001[/TD]
[TD]2/2/2018[/TD]
[TD]7:53 PM[/TD]
[/TR]
[TR]
[TD]20180202-002[/TD]
[TD]2/2/2018[/TD]
[TD]8:53 PM[/TD]
[/TR]
[TR]
[TD]20180202-003[/TD]
[TD]2/2/2018[/TD]
[TD]9:53 PM[/TD]
[/TR]
</tbody><colgroup><col><col><col></colgroup>[/TABLE]
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
It's not clear from your sample what you are trying to do. Are you trying to split the date and time or what?
 
Upvote 0
Hi, it's not that clear to me either - but if you are trying to generate the "unique_id" column - here are a couple of options (assuming that you have two distinct sets of data)


Excel 2013/2016
ABC
1Unique_iddate
220180201-00102/01/2018 07:53:00
320180201-00202/01/2018 08:53:00
420180201-00302/01/2018 09:53:00
520180202-00102/02/2018 07:53:00
620180202-00202/02/2018 08:53:00
720180202-00302/02/2018 09:53:00
8
9Unique_iddatedate_1
1020180201-00102/01/201807:53
1120180201-00202/01/201808:53
1220180201-00302/01/201809:53
1320180202-00102/02/201807:53
1420180202-00202/02/201808:53
1520180202-00302/02/201809:53
Sheet1
Cell Formulas
RangeFormula
A2=TEXT(B2,"YYYYMMDD")&TEXT(COUNTIFS(B$2:B2,">="&INT(B2),B$2:B2,"<"&INT(B2)+1),"-000")
A10=TEXT(B10,"YYYYMMDD")&TEXT(COUNTIFS(B$10:B10,B10),"-000")
 
Upvote 0
I think he's trying to autonumber each row in two different groups

Edit: Yes like that^^^^^^^
 
Last edited:
Upvote 0
Looking for an Auto number and whichever is easier date and time in the same cell or different cells.
 
Upvote 0
FormR's solution seems to do what you want

or if you're trying to start at 7:53 and add an hour every +1 increase the formula can be easily changed.
 
Last edited:
Upvote 0
That was perfect, the dates and time in the example were just made up. It could end up being any time. my file has a date and time stamp in a column and I wanted the incremental number based on that column.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,154
Members
453,021
Latest member
Justyna P

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