Solved

Need help formatting a Date in Excel

Posted on 2014-01-03
5
325 Views
Last Modified: 2014-01-27
Hi Experts,
I have a PostDate column on a spreadsheet that has the following format: 20121031

The first four characters are the year, characters 5 and 6 are for the month, and characters 7 and 8 are for the day value.

I need to create a new column that copies the values from the values in the PostDate column, but uses the following date format 10-31-2012.  How can i do this?  

Thanks in advance,
mrotor
0
Comment
Question by:mainrotor
5 Comments
 
LVL 26

Expert Comment

by:pony10us
ID: 39755154
Try this:

=CONCATENATE(MID(A1,5,2),"-",RIGHT(A1,2),"-",LEFT(A1,4))

Open in new window

0
 
LVL 18

Accepted Solution

by:
Steven Harris earned 500 total points
ID: 39755155
=CONCATENATE(MID(B4,5,2),"-",RIGHT(B4,2),"-",LEFT(B4,4))

Substitute B4 for the cell where the date is.

EDIT
They really need to have auto-refresh of pages for new posts...
0
 
LVL 26

Expert Comment

by:pony10us
ID: 39755159
:)  true but at least you added the comment about substitution that I didn't have.
0
 
LVL 16

Expert Comment

by:Jerry Paladino
ID: 39755928
=DATEVALUE(MID(A1,5,2) & "-" & RIGHT(A1,2) & "-" & LEFT(A1,4))

Converts the text to an Excel serial date.     (41213 for 10-31-2012)

Then use Format/Cells/Number and pick the mm-dd-yyyy format for the cell(s).  Or any other date format that you might want.
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 39759068
Will your date string always be 8 characters?

What happens when you have a single digit month and/or single digit day?

Just a couple of points to consider.

Thanks
Rob H
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question