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.
Unique_iddatedate_1
20180201-0012/1/2018 7:53
20180201-0022/1/2018 8:53
20180201-0032/1/2018 9:53
20180202-0012/2/2018 7:53
20180202-0022/2/2018 8:53
20180202-0032/2/2018 9:53
20180201-0012/1/20187:53 AM
20180201-0022/1/20188:53 AM
20180201-0032/1/20189:53 AM
20180202-0012/2/20187:53 PM
20180202-0022/2/20188:53 PM
20180202-0032/2/20189:53 PM

<tbody>
</tbody><colgroup><col><col><col></colgroup>
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
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,217,367
Messages
6,136,140
Members
449,994
Latest member
Rocky Mountain High

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