Solved

Changing the date format from  dd/mm/yyyy to ddmmyy in excel 2010

Posted on 2016-10-04
8
67 Views
Last Modified: 2016-10-04
Hi

I have an  2010 excel file with 200 user details  and their date of birth is populated in  dd/mm/yyyy ( 29/06/2001)on one of the colums.
I want to convert this format into ddmmyy  (290601) . This data is on colum H and if i go to the particular row and remove the / and 20, some other date populates.

Please let me know if there is a way to achieve this.
Thanks
0
Comment
Question by:lianne143
  • 3
  • 3
  • 2
8 Comments
 
LVL 28

Assisted Solution

by:Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj) earned 250 total points
ID: 41828048
Assuming your date is in H2 then try this....
=TEXT(DATE(RIGHT(H2,4),MID(H2,4,2),LEFT(H2,2)),"ddmmyy")

Open in new window

0
 
LVL 28

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41828062
Or you may try the following code to change the dates in the desired format...

Sub ChangeDateFormat()
Dim lr As Long
Dim rng As Range, cell As Range
lr = Cells(Rows.Count, "H").End(xlUp).Row
Set rng = Range("H2:H" & lr)
For Each cell In rng
   cell = Format(cell.Value, "ddmmyy")
Next cell
End Sub

Open in new window

0
 
LVL 95

Assisted Solution

by:Lee W, MVP
Lee W, MVP earned 250 total points
ID: 41828063
Use a custom format. Enter the dates CORRECTLY when typing them in - for example 6/29/01 but set the custom format for the cells to be "ddmmyy"
0
 

Author Comment

by:lianne143
ID: 41828064
All the 200 date of birth is on the colum H  and it starts from H2 to H218
Please post me the formula for this

Thanks
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 28

Assisted Solution

by:Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj) earned 250 total points
ID: 41828073
I assume default date format at your end is US date format i.e. mm/dd/yyyy so the dates what you get won't be recognized as dates. Remember that dates are treated as numbers by Excel behind the scene and in this case your dates look like dates but they are text strings.

To convert them to the desired format, try one of the suggested solutions.
If you place the formula in I2, you just need to copy it down and if you go for the VBA solution, you just need to run the code once to get all the dates in column H into the desired date format.
0
 

Author Comment

by:lianne143
ID: 41828094
Hi Subodh

Please post me step by step instructions and my Excel sheet is called data
All the 200 date of birth is on the colum H  and it starts from H2 to H218
Thanks
0
 
LVL 95

Accepted Solution

by:
Lee W, MVP earned 250 total points
ID: 41828125
Repeat - use a custom format but enter the dates in whatever local date format you normally use.
This is simple.  Right click the column (or select the cells), select format cells, select custom under category, type in "ddmmyy" as the format.

DONE.
0
 

Author Comment

by:lianne143
ID: 41828170
Thanks you very much Lee
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel Score Formula 5 47
Merging-Splitting-Multiple-Rows 33 42
In search of x17-22375.exe 2 12
Access Excel export not behaving 2 25
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now