Unifi two date formats where one is DATE and the other is TEXT

pitaszek

Board Regular
Joined
Jul 20, 2012
Messages
85
Hello everyone,

I've got data set which has two date formats where one is DATE and the other is TEXT. Ideally I would like VBA to convert TEXT to date. I appreciate any helpful tips! Sample format is as follows:

Shorter one is DATE, longer with timestamp is TEXT. Ideal ouput is eg. 11/01/2016 as a date format.
[TABLE="width: 117"]
<tbody>[TR]
[TD="align: right"]12/31/2016 23:59
[/TD]
[/TR]
[TR]
[TD="align: right"]11/01/2016
[/TD]
[/TR]
[TR]
[TD="align: right"]12/31/2016 23:59
[/TD]
[/TR]
[TR]
[TD="align: right"]12/31/2016 23:59
[/TD]
[/TR]
[TR]
[TD="align: right"]12/31/2016 23:59
[/TD]
[/TR]
[TR]
[TD="align: right"]09/30/2016 23:59
[/TD]
[/TR]
[TR]
[TD="align: right"]10/17/2016 23:59
[/TD]
[/TR]
[TR]
[TD="align: right"]11/15/2016 23:59
[/TD]
[/TR]
[TR]
[TD="align: right"]09/30/2016 23:59
[/TD]
[/TR]
[TR]
[TD="align: right"]11/01/2016
[/TD]
[/TR]
[TR]
[TD="align: right"]11/01/2016
[/TD]
[/TR]
[TR]
[TD="align: right"]09/30/2016 23:59
[/TD]
[/TR]
</tbody>[/TABLE]

Thank you very much dear community,
W
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi,

I don't know about a macro but = Value(cell with date in) will convert it to a number and then format the the cell as date. It works with both your date types
 
Upvote 0
Thanks for your contribution BGY23. This solution is good, but I feel like new dates do not behave like actual dates. If you try to filter on dates you will see that they would group into Months and Years automatically.
 
Upvote 0
If you filter by date and which have proper date format they would be seen in the filter as grouped for years and months while created using VALUE and TEXT, DATE functions as BGY23 proposes do not.
dategrouping02.png
 
Last edited:
Upvote 0
Are you sure that they aren't all dates but from a region that has it's date format as mm/dd/yyyy and yours is dd/mm/yyyy which means it will be text to you if it is past the 12th of the month?
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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