Solved

Date formatting from US to UK when cell is being read numerically instead of date format ?

Posted on 2016-08-09
8
47 Views
Last Modified: 2016-08-10
HI Guys

Hope you can help

Im having trouble converting a column with US dates as the section where it converts to UK dates still reads the data in numeric form (ie. instead of 08/01/2016 it still thinks the cell has 42325 (or whatever the conversion may be) as the result)

I have attached the sheet in question

Basically, the data gets pasted in and Column M contains the US dates
Column AT pulls the in the date whilst Column AU switched the date around to UK and then formats it in AV in order to split it into the yellow section for financial purposes.
However, when I paste the data in, and column AT populates the dates, column AU still believes the date in AT to be in numeric form and no matter how much I try to pre-format the cells, I cannot get this to change correctly.

Do you guys have any ideas as how to overcome this or is there a simpler method of converting the US date to UK format?

J
EE_Example.xlsm
0
Comment
Question by:spicecave
8 Comments
 
LVL 94

Expert Comment

by:John Hurst
ID: 41749031
Dates as a number within the sheet are independent of format.

Set the format of the target column as UK format and when you paste data into it, use Paste Special, Values and they should then get the new format
0
 
LVL 22

Expert Comment

by:yo_bee
ID: 41749037
Right click on the column and select format.
Under Local change it to  English(United Kingdom)

img1
0
 
LVL 94

Expert Comment

by:John Hurst
ID: 41749045
If you paste US date into UK date, US date will be pasted in. You need to paste. special, values to keep the target formatting
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 21

Accepted Solution

by:
Ejgil Hedegaard earned 500 total points
ID: 41749048
If the suggestion from John Hurst is not possible, you can use this formula to transform the dates.

=IF(ISNUMBER(M2),DATE(YEAR(M2),DAY(M2),MONTH(M2)),DATE(RIGHT(M2,4),LEFT(M2,2),MID(M2,4,2)))

Open in new window

0
 
LVL 30

Expert Comment

by:Subodh Tiwari (Neeraj)
ID: 41749068
What I am missing here?

In Col. AT, you have formula =IF(M2="","",M2) to fetch the dates from col. M which are in US date format. Right?
Then why not custom format the col. AT itself with "dd/mm/yyyy" to show the dates in UK format?
And then in AW2 you can use the formula =TEXT(AT2,"mmm-yy") to show the date in AT2 as Mon-Year or whatever format you like.

Point to remember is by changing the date format doesn't change the underlying date in anyway, the date remains the same. Also excel treats dates as numbers, which you can see if you format a date cell with General format.
0
 
LVL 21

Expert Comment

by:Ejgil Hedegaard
ID: 41749188
When dates as text from another system are pasted, Excel tries to help, and converts what looks as a date to a date, so when US dates has month <= 12, it is converted to UK dates, but when month > 12, it is pasted a text.
08/12/2016 will convert to 08-12-2016, but should be 12-08-2016.
08/13/2016 will be the text "08/13/2016" but should be 13-08-2016.
The formula above checks if it is a date (numeric), and switch day and month, and if it a text, extracts the year, month and day to make a real date.
0
 

Author Closing Comment

by:spicecave
ID: 41750029
This worked perfect

Thank you so much (and everyone) for your help

Much appreciated

J
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 41750034
If it is text values being pasted in, you can then use the Text to Columns wizard to convert to numbers.

In step 3 of the wizard, in the left hand side choose Date and then choose the dropdown for MDY which tells the conversion that the source is in US format. This will then ensure that all dates are inserted correctly.

The conversion to UK format can then be a simple =IF(M2="","",M2) as mentioned by neeraj above and then format this column as UK format.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

830 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