Excel/Date formatting

Advertisement


Question
Good Morning

I hope you can help me out. I am trying to find a solution to an issue that I have.

I have some data that I have extracted from a server and it has been taken straight into excel. Now, I am trying to manipulate the data so that I can export it again into Microsoft Access. This will be so that I can then run a pivot table through Access. What I am having trouble is with the date. When I have originally extracted it it comes in the format of dd/mm/yyyy hh:mm:ss e.g. 01/04/2013 00:00:00. I need to change this so that in one cell I have the day the next cell I have the month (in text format), the next cell I have the year and after that I get the time.
I am able to split the cells using text to columns so am fine splitting them. What I need is for the Month to be in text i.e. 04 = April. I have changed the format but when I split it it goes back to "04".
Please can you assist as I am completely stumped.

Thanks a lot

Stuart

Answer
Stuart,

If you take on off the cells and format it as general does it appear as

41365  (this is for you example:  01/04/2013 00:00:00  - Apr 1, 2013)

If it does, then you can click undo to get it back to the original format; but that establishes that the values are stored as excel dates/times and not a text string that looks like a date and time.  (you also say "I have changed the format" so that reinforces that it is stored as a date/time value)

So if it is stored as a date/time,  you can extract the various items.  Assume the above value is in B2

=Month(B2)  will produce 4.  But You can get the word April instead with

=Text(B2,"mmmm")
or Apr with  =Text(B2,"mmm")

To get the day you can do

=Day(B2)

to get the year

=Year(B2)

you can get the time with

=Text(B2,"hh:mm:ss")

You can put these in adjacent columns and then select them and drag fill down next to your data.

You can replace the formulas with the results they return by selecting the columns, do a copy , then paste values.

Once you have replace the formulas with the values they return, you can delete the column with the original data.  

--
Regards,
Tom Ogilvy  
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

Excel

All Answers


Answers by Expert:


Ask Experts

Volunteer


Tom Ogilvy

Expertise

Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]

Experience

Extensive experience.

Education/Credentials
Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2016 About.com. All rights reserved.