Hi there in excel when you custom time ie hh.mm when I input it it doesn’t do what I type any ideas please
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
help with time in excel
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » help with time in excel
- This topic has 22 replies, 6 voices, and was last updated 9 years, 11 months ago.
Viewing 14 reply threadsAuthorReplies-
RetiredGeek
AskWoody_MVPJune 26, 2015 at 10:17 am #1512143Mar27,
Ok your custom format has a period (.) between the hours & minutes. However, when you enter the value you must use the colon[noparse] (:)[/noparse] between the minutes and seconds for Excel to recognize that you are entering a time. If you do this the time will display as 10.45 even though you entered it as 10:45. HTH :cheers:
-
WSmar27
AskWoody LoungerJune 26, 2015 at 10:44 am #1512147Mar27,
Ok your custom format has a period (.) between the hours & minutes. However, when you enter the value you must use the colon[noparse] (:)[/noparse] between the minutes and seconds for Excel to recognize that you are entering a time. If you do this the time will display as 10.45 even though you entered it as 10:45. HTH :cheers:
I have done that which has worked on most of my sheet but when I input ie 57:00 I am getting this instead 02/01/1900 09:00:00
-
access-mdb
AskWoody MVPJune 26, 2015 at 11:01 am #1512154I have done that which has worked on most of my sheet but when I input ie 57:00 I am getting this instead 02/01/1900 09:00:00
This is correct as you now have 57 hours from 1 Jan 1900 at midnight. hh:mm (however formatted) is clock time not a count of hours and minutes.
The question is – what are you using the data for? If just displaying an elapsed time then formatting the cell as text will do the trick. It becomes a bit more complicated if you want to use the numbers in a calculation.
Eliminate spare time: start programming PowerShell
-
-
-
RetiredGeek
AskWoody_MVPJune 26, 2015 at 10:52 am #1512150Mar27,
Ok, I’m guessing you’re using the dd/mm/yyyy date format (European I’m guessing since you didn’t post your location).
57 Hours = 2 Days 9 Hours thus -> Counting from 1/1/1900 + 2 Days + 9 Hours = 2 Jan 1900 @ 09:00. HTH :cheers: -
WSmar27
AskWoody Lounger -
RetiredGeek
AskWoody_MVPJune 26, 2015 at 12:54 pm #1512171Mar27,
I’m a bit at a loss to understand your worksheet.
Row 26 shows 20 hours to fall asleep but only 7:19 in bed?
Could you please explain the logic between the columns as it will surely help with arriving at a solution.
BTW: You can use this formula to calculate time in bed. [noparse]=($A3+1+$C3)-($A3+$B3)[/noparse]
Place in cell G3 then fill down.HTH :cheers:
-
WSmar27
AskWoody Lounger -
WSX_LD
AskWoody Lounger -
WSmar27
AskWoody Lounger -
Paul T
AskWoody MVP -
WSmar27
AskWoody Lounger -
zeddy
AskWoody_MVPJune 27, 2015 at 9:47 am #1512299Hi Mar
I suspect what you really want is just an easy way to enter time values.
In my attached version you can enter 1, 2 , 3 or 4 digits
if you enter a single digit, it assumes it is hours. e.g 8 =>08:00
if you enter 2 digits, it assumes minutes e.g 57 => 00:57
if you enter a number with a decimal: left of decimal is treated as hours as follows:
20.3 =>20:30; 21.17 =>21:17; 8.25 =>08:25; 8.4 => 08.40
If you enter 3 digits, it is assumed to be hmm e.g. 625 =>06:25; 123 =>01:23; 755 =>07:55
if you enter 4 digits, it is assumed to be hhmm
..have a try, and see if this is what you wantzeddy
-
-
Paul T
AskWoody MVP -
WSmar27
AskWoody Lounger
-
-
WSX_LD
AskWoody Lounger -
access-mdb
AskWoody MVPJune 27, 2015 at 8:32 am #1512288I’ve just tried Paul’s suggestion and it displays as 57.00 (though when the focus is in that cell the contents are displayed above as 02/01/1900 09:00:00). Are you sure that you’ve entered the format correctly as he suggested?
X_LD, that doesn’t work as the OP requires. At least I get an answer of 1368:00….
Eliminate spare time: start programming PowerShell
-
WSmar27
AskWoody Lounger -
zeddy
AskWoody_MVP
-
-
access-mdb
AskWoody MVP -
zeddy
AskWoody_MVPJune 27, 2015 at 4:10 pm #1512338Hi access-mdb
..it works using the event code for the sheet (right-click on the sheet tabname, then select View Code)
Here is the code I used. It could be probably be improved, I just did it quickly:
Target is the cell that is changed (i.e. edited or entered) by the User.Code:Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count > 1 Then Exit Sub zRow = Target.Row zCol = Target.Column If zRow [h1].Column Then Exit Sub zValue = Target.Value Application.EnableEvents = False Select Case zCol Case [b1].Column, [c1].Column, [d1].Column, [g1].Column, [h1].Column If zValue Like "#" Then Target = zValue & ":00" 'single digit assumed to be hour If zValue Like "#." Then Target = zValue & ":00" 'assumed to be hour If zValue Like "##." Then Target = zValue & ":00" 'assmed to be hour If zValue Like "##" Then Target = "00:" & zValue 'assumed to be minutes If zValue Like "#.#" Then 'treat as h:m0 e.g. 4.3 => 04:30 zHr = Left(zValue, 1) zMin = Right(zValue, 1) Target = zHr & ":" & zMin & "0" End If If zValue Like "#.##" Then 'treat as h:mm e.g. 6.25 => 06:25 zHr = Left(zValue, 1) zMin = Right(zValue, 2) Target = zHr & ":" & zMin End If If zValue Like "##.#" Then 'treat as hh:m0 e.g. 17.3 => 17:30 zHr = Left(zValue, 2) zMin = Right(zValue, 1) Target = zHr & ":" & zMin & "0" End If If zValue Like "##.##" Then 'treat as hh:mm e.g. 12.55 => 12:55 zHr = Left(zValue, 2) zMin = Right(zValue, 2) Target = zHr & ":" & zMin End If If zValue Like "####" Then 'assume to be hhmm e.g. 2015 => 20:15 zHr = Left(zValue, 2) zMin = Right(zValue, 2) Target = zHr & ":" & zMin End If If zValue Like "###" Then 'assumed to be hmm e.g 725 => 07:25 zHr = Left(zValue, 1) zMin = Right(zValue, 2) Target = zHr & ":" & zMin End If Case Else End Select Application.EnableEvents = True End Sub
zeddy
-
-
access-mdb
AskWoody MVP -
zeddy
AskWoody_MVP
-
Viewing 14 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Windows AI Local Only no NPU required!
by
RetiredGeek
2 hours, 12 minutes ago -
Stop the OneDrive defaults
by
CWBillow
5 hours, 15 minutes ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
7 hours, 40 minutes ago -
X Suspends Encrypted DMs
by
Alex5723
9 hours, 52 minutes ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
10 hours, 10 minutes ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
10 hours, 47 minutes ago -
OpenAI model sabotages shutdown code
by
Cybertooth
11 hours, 24 minutes ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
6 hours, 42 minutes ago -
Enabling Secureboot
by
ITguy
6 hours, 34 minutes ago -
Windows hosting exposes additional bugs
by
Susan Bradley
19 hours, 19 minutes ago -
No more rounded corners??
by
CWBillow
15 hours, 7 minutes ago -
Android 15 and IPV6
by
Win7and10
4 hours, 52 minutes ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
1 day, 7 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
1 day, 10 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
1 day, 4 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
1 day, 17 hours ago -
May preview updates
by
Susan Bradley
1 day, 5 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
20 hours, 39 minutes ago -
Just got this pop-up page while browsing
by
Alex5723
1 day, 9 hours ago -
KB5058379 / KB 5061768 Failures
by
crown
1 day, 6 hours ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
9 hours, 7 minutes ago -
At last – installation of 24H2
by
Botswana12
2 days, 9 hours ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
5 hours, 54 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
2 days, 21 hours ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
19 hours, 50 minutes ago -
Limited account permission error related to Windows Update
by
gtd12345
3 days, 10 hours ago -
Another test post
by
gtd12345
3 days, 11 hours ago -
Connect to someone else computer
by
wadeer
3 days, 5 hours ago -
Limit on User names?
by
CWBillow
3 days, 8 hours ago -
Choose the right apps for traveling
by
Peter Deegan
2 days, 22 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.