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 Update orchestration platform to update all software
by
Alex5723
23 minutes ago -
May preview updates
by
Susan Bradley
2 hours, 1 minute ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
2 hours, 8 minutes ago -
Just got this pop-up page while browsing
by
Alex5723
3 minutes ago -
KB5058379 / KB 5061768 Failures
by
crown
12 hours, 31 minutes ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
15 hours, 10 minutes ago -
At last – installation of 24H2
by
Botswana12
15 hours, 54 minutes ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
5 hours, 32 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
1 day, 4 hours ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
21 hours, 26 minutes ago -
Limited account permission error related to Windows Update
by
gtd12345
1 day, 17 hours ago -
Another test post
by
gtd12345
1 day, 17 hours ago -
Connect to someone else computer
by
wadeer
1 day, 12 hours ago -
Limit on User names?
by
CWBillow
1 day, 15 hours ago -
Choose the right apps for traveling
by
Peter Deegan
1 day, 5 hours ago -
BitLocker rears its head
by
Susan Bradley
13 hours, 7 minutes ago -
Who are you? (2025 edition)
by
Will Fastie
12 hours, 4 minutes ago -
AskWoody at the computer museum, round two
by
Will Fastie
1 day, 7 hours ago -
A smarter, simpler Firefox address bar
by
Alex5723
2 days, 4 hours ago -
Woody
by
Scott
2 days, 13 hours ago -
24H2 has suppressed my favoured spider
by
Davidhs
12 hours, 44 minutes ago -
GeForce RTX 5060 in certain motherboards could experience blank screens
by
Alex5723
3 days, 3 hours ago -
MS Office 365 Home on MAC
by
MickIver
2 days, 21 hours ago -
Google’s Veo3 video generator. Before you ask: yes, everything is AI here
by
Alex5723
3 days, 17 hours ago -
Flash Drive Eject Error for Still In Use
by
J9438
12 hours, 28 minutes ago -
Windows 11 Insider Preview build 27863 released to Canary
by
joep517
4 days, 12 hours ago -
Windows 11 Insider Preview build 26120.4161 (24H2) released to BETA
by
joep517
4 days, 12 hours ago -
AI model turns to blackmail when engineers try to take it offline
by
Cybertooth
3 days, 16 hours ago -
Migrate off MS365 to Apple Products
by
dmt_3904
3 days, 17 hours ago -
Login screen icon
by
CWBillow
3 days, 7 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.