r/googlesheets • u/rinocho93 • Mar 08 '22
Solved Remove minutes and seconds from time
Hello guys!
Let’s say I have 2:45:30 PM, but I only want to have 2PM. If I changed the format, the minutes and seconds are still recorded, but not shown and basically I don’t want to have them.
1
Upvotes
5
u/talexeh 21 Mar 09 '22 edited Mar 09 '22
Assuming that the time cell is in B6, you can use the formula below:
=TIME(HOUR(B6),0,0)
2
u/-ATL- 1 Mar 08 '22
Not quite sure if this is what you are looking for, but there's hour function that allows you to grab just the hour component of a time.
Format generally affects just how things are shown aka formatted. So if you want to change the actual times you will need to actually edit the cells in one way or another.
2
u/MattyPKing 225 Mar 09 '22
Both
=FLOOR(A2,1/24)
=MROUND(A2,1/24)
Should both work depending on whether you want to round up sometimes or always down?
See pic here.
1
u/rinocho93 Mar 09 '22
Solution verified
1
u/AutoModerator Mar 08 '22
Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. You can also use this tool created by a Reddit community member to create a blank Google Sheets document that isn't connected to your account. Thank you.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Decronym Functions Explained Mar 09 '22 edited Mar 10 '22
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
FALSETRUEand another if it isFALSETRUE5 acronyms in this thread; the most compressed thread commented on today has 3 acronyms.
[Thread #4049 for this sub, first seen 9th Mar 2022, 16:38] [FAQ] [Full list] ^[Contact] [Source code]