Converting data to time

sandramac
sandramac used Ask the Experts™
on
Cell A1 contains a value, I want to add one hour to that number and display in the next row down.  I need to do this for the next 30 rows down.  The problem I am having is once I get to 12,  I don't know how to make the next number 1, instead of 13.  Below is how I need it to look
8
9
10
11
12
1
2
3
4
5
6
7
8
9
10
11
12
1, and so on.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Subodh Tiwari (Neeraj)Excel & VBA Expert
Most Valuable Expert 2018
Awarded 2015

Commented:
One way...
In A2
=IF(A1=12,1,A1+1)

Open in new window

and copy it down.
Retired
Top Expert 2012
Commented:
Another way:
= 1+ MOD(A1, 12)
ShumsManaging Director/Excel VBA Developer
Distinguished Expert 2018

Commented:
If you want to fill without formula then follow these steps to enter 1-hour time increments in the range A1:A30:
1. Select A1:A30
2. Right-click the selection and select Format Cells.
3. Click Time and select 1:30 PM and click OK.
4. Click A1 and enter 08:00 AM (or whatever time you like to enter)
5. Select A2:A30 and enter =A1+Time(1,0,0)
6. Press [Ctrl][Enter]
Excel fills the range with 1-Hour time increments.
Please find attached for reference:
Increment-1-Hour.xlsx

Author

Commented:
Thank You

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial