Convert american date to Australian date (data in text format)

Barto

Board Regular
Joined
Jul 30, 2013
Messages
78
Hi,

I am having to load data into excel that has a date column. I have these challenges with converting the date from American format to Australian format (e.g. 4/2/20 to 4/2/20)
1. its in text format
2. number of characters are not consistent. For example the 2nd April shows as 4/2/20 (6 characters) and 10th April is 4/10/20 (7 characters) and 10th Oct is 10/10/20 (8 characters) so there is no consistency in characters.
3. its one data dump. Text to column is not an option. This is the first column of a data table.

Any formula out there to resolve this?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Text to column is not an option
Why do you say that?

Select the column
Text to Columns
Delimited
Next
Make sure / is not entered in the 'Other' box
Next
Select MDY in the Date drop-Down
Finish
 
Upvote 0
Because I'm building an interim report where I'm dumping data each day and dont want to have to do rext to columns everytime i dump data.

The data has 14 columns (A-O).... some columns with merge cells (very messy). Column A has the date. So looking for a formula option I can put in column P that looks at the date and converts it.

I have no admin control on the data given to me and will need to work with what I'm given for 3-6mths.

Formula solutions only please
 

Attachments

  • Capture.PNG
    Capture.PNG
    17 KB · Views: 40
Upvote 0
Presumably, any dates where the day is 13 or greater are already correctly rendered. That said, the following macro converts date strings and values in a selected range between mm/dd/yyyy and dd/mm/yyyy. The output is in the form of date values that you can format as dates via Format|Cells|Number|Date.

Sub ConvertDateFormat()
Dim DtRange As Range, oCell As Range, oTxt As String
If Selection.Cells.Count = 1 Then
Set DtRange = ActiveCell
Else
Set DtRange = Selection
End If
With Application
On Error Resume Next ' In case there are no xlConstants or convertible dates in DtRange
For Each oCell In DtRange.SpecialCells(xlConstants)
oTxt = oCell.Text
If UBound(Split(oTxt, "/")) = 2 Then _
oCell.Value = CDate(Split(oTxt, "/")(1) & "/" & Split(oTxt, "/")(0) & "/" & Split(oTxt, "/")(2))
Next oCell
End With
End Sub

Note that no conversion is performed if the date is embedded in a formula or the output would be an invalid date.
 
Upvote 0
Are you, or could you use a macro to manipulate your data?

In the interim, you could try this formula if you definitely want a formula approach.

20 04 03.xlsm
AB
1Date USDate AUS
24/2/202/04/2020
34/18/2018/04/2020
410/10/2010/10/2020
Date swap
Cell Formulas
RangeFormula
B2:B4B2=DATEVALUE(MID(SUBSTITUTE(A2,"/","/"&LEFT(A2,FIND("/",A2)),2),FIND("/",A2)+1,10))
 
Upvote 0
Are you, or could you use a macro to manipulate your data?

In the interim, you could try this formula if you definitely want a formula approach.

20 04 03.xlsm
AB
1Date USDate AUS
24/2/202/04/2020
34/18/2018/04/2020
410/10/2010/10/2020
Date swap
Cell Formulas
RangeFormula
B2:B4B2=DATEVALUE(MID(SUBSTITUTE(A2,"/","/"&LEFT(A2,FIND("/",A2)),2),FIND("/",A2)+1,10))
Thank you looks like this works
 
Upvote 0
Are you, or could you use a macro to manipulate your data?

In the interim, you could try this formula if you definitely want a formula approach.

20 04 03.xlsm
AB
1Date USDate AUS
24/2/202/04/2020
34/18/2018/04/2020
410/10/2010/10/2020
Date swap
Cell Formulas
RangeFormula
B2:B4B2=DATEVALUE(MID(SUBSTITUTE(A2,"/","/"&LEFT(A2,FIND("/",A2)),2),FIND("/",A2)+1,10))

Hi Peter,

I have another issue. A additional extract where the data comes through as datetime format but because the date is in american format excel recognises the incorrect date.
For example 4/03/2020 1:00:00 AM. This is actually 3rd April but my excel thinks its 4th March because I'm an Australian excel user.
I have tried modifying the previous formula provided but because in this instance its not text is does work.
Any idea on a formula solution here

Interval Start
4/03/2020 1:00​
4/04/2020 1:00​
4/05/2020 1:00​
 
Upvote 0
Any idea on a formula solution here
Which results are you wanting, column B or C?

20 04 06.xlsm
ABC
14/03/2020 1:003/04/20203/04/2020 1:00
24/04/2020 1:004/04/20204/04/2020 1:00
34/15/2020 1:0015/04/202015/04/2020 1:00
Sheet2 (2)
 
Upvote 0

Forum statistics

Threads
1,215,343
Messages
6,124,405
Members
449,157
Latest member
mytux

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top