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
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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
-
Woody (Awaiting moderation)
by
Scott
3 hours, 52 minutes ago -
24H2 has suppressed my favoured spider
by
Davidhs
6 hours, 10 minutes ago -
GeForce RTX 5060 in certain motherboards could experience blank screens
by
Alex5723
14 hours, 6 minutes ago -
MS Office 365 Home on MAC
by
MickIver
7 hours, 55 minutes ago -
Google’s Veo3 video generator. Before you ask: yes, everything is AI here
by
Alex5723
1 day, 4 hours ago -
Flash Drive Eject Error for Still In Use
by
J9438
1 day, 5 hours ago -
Windows 11 Insider Preview build 27863 released to Canary
by
joep517
1 day, 23 hours ago -
Windows 11 Insider Preview build 26120.4161 (24H2) released to BETA
by
joep517
1 day, 23 hours ago -
AI model turns to blackmail when engineers try to take it offline
by
Cybertooth
1 day, 2 hours ago -
Migrate off MS365 to Apple Products
by
dmt_3904
1 day, 3 hours ago -
Login screen icon
by
CWBillow
17 hours, 52 minutes ago -
AI coming to everything
by
Susan Bradley
3 hours, 12 minutes ago -
Mozilla : Pocket shuts down July 8, 2025, Fakespot shuts down on July 1, 2025
by
Alex5723
2 days, 14 hours ago -
No Screen TurnOff???
by
CWBillow
2 days, 15 hours ago -
Identify a dynamic range to then be used in another formula
by
BigDaddy07
2 days, 15 hours ago -
InfoStealer Malware Data Breach Exposed 184 Million Logins and Passwords
by
Alex5723
3 days, 3 hours ago -
How well does your browser block trackers?
by
n0ads
2 days, 13 hours ago -
You can’t handle me
by
Susan Bradley
12 hours, 16 minutes ago -
Chrome Can Now Change Your Weak Passwords for You
by
Alex5723
2 days, 6 hours ago -
Microsoft: Over 394,000 Windows PCs infected by Lumma malware, affects Chrome..
by
Alex5723
3 days, 14 hours ago -
Signal vs Microsoft’s Recall ; By Default, Signal Doesn’t Recall
by
Alex5723
2 days, 18 hours ago -
Internet Archive : This is where all of The Internet is stored
by
Alex5723
3 days, 14 hours ago -
iPhone 7 Plus and the iPhone 8 on Vantage list
by
Alex5723
3 days, 15 hours ago -
Lumma malware takedown
by
EyesOnWindows
3 days, 3 hours ago -
“kill switches” found in Chinese made power inverters
by
Alex5723
3 days, 23 hours ago -
Windows 11 – InControl vs pausing Windows updates
by
Kathy Stevens
3 days, 23 hours ago -
Meet Gemini in Chrome
by
Alex5723
4 days, 3 hours ago -
DuckDuckGo’s Duck.ai added GPT-4o mini
by
Alex5723
4 days, 4 hours ago -
Trump signs Take It Down Act
by
Alex5723
4 days, 11 hours ago -
Do you have a maintenance window?
by
Susan Bradley
2 days, 16 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.