Excel 2010-2019
Excel 2007
Excel 2003
Tips & Tricks
Excel Forum
Course Index CIG Excel Book
 
Home   News   Courses   Tips   Templates   Forums   Help   Order   Contact   Logon  
 
 
Excel: Separating Time & Date
By Richard Rost   Richard Rost on Facebook Richard Rost on Twitter Richard Rost on LinkedIn Email Richard Rost   5/19/2008 1:11:52 PM

Q: How do I remove the date from a cell with both the date and time (the date seems to show up automatically, although I'm only interested in the time). In short, I want to go from "4/7/2008 6:18:00 AM" to "6:18:00 AM". Thanks, Lauren.


A: Lauren, the only easy way I've found to do this is to break up the date/time into its components (day, month, year, etc.) and then put them back together again with the DATE() and TIME() functions.

For example, let's say A1 has: 4/7/2008 6:18:00 AM

Put the following functions in the next cells:

B1 = YEAR(A1)
C1 = MONTH(A1)
D1 = DAY(A1)
E1 = HOUR(A1)
F1 = MINUTE(A1)
G1 = SECOND(A1)

Now put them all back together:

H1 = DATE(B1, C1, D1)
I1 = TIME(E1, F1, G1)

That's about the only easy way to do it and still keep the value as a DATE/TIME and not text (you could do it with string concatenation too, but you would then have to convert it back to a date).

Link 
Richard Rost 
9/8/2008
Sanat, try using the LEFT and RIGHT commands. For example, if your value is in cell A1, then in B1 put the following:

=LEFT(A1,2)&"-"&RIGHT(A1,2)

That should give you what you want.
Add a Reply
Link 
Sanat 
8/28/2008
I have a column with the numbers like SS02. How do I make it look like SS-02 in Excel. Thanks.
Add a Reply
Link 
Richard Rost 
7/22/2008
John, that is an EXCELLENT and very elegant solution. I did not think of that. Thank you!
Add a Reply
Link 
John Mosher 
7/15/2008
I've been struggling with this myself because I have a database that was exporting an elapsed time as a date and time. I figured out the following single cell solution.

Assuming the date and time is in cell A1 use the following formula =MOD(A1,1). You can then format the results with whatever time format you want. Read More...
Add a Reply
Link 
Richard Rost 
7/1/2008
Jim, you can do that with Window > Freeze Panes. I cover it in Excel 103.
Add a Reply

Show Older Comments...
View in Table Format

Post a New Comment or Question
 
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.
 
Subscribe
 

You may want to read these articles from the 599CD News:

7/27/2020How to Get Microsoft Excel for Free
6/5/2020Excel Worksheet Change VBA
5/25/2020Excel Expert 11
5/23/2020Excel XLOOKUP Function
5/20/2020Excel My Name is Richard
5/20/2020Excel Expert Level 11
5/20/2020Excel Expert 11 Outline
5/4/2014Microsoft Access Expert 20
3/5/2013Excel Tip: Price Markups
2/3/2013Signed Copies of my Excel Book
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
Lost Password
Free Upgrades
Insider Circle
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Articles
Search The Site
Waiting List
Production Schedule
Collapse Menus
Help
 
Live Chat
Customer Support
WalkThru Tutorials
Troubleshooting
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
MYOLP Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Live Chat
General Info
Support Policy
Contact Form
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

YouTube Channel    LinkedIn

Blog RSS Feed   
Keywords: excel tips year month day hour minute second date time  PermaLink