I received a workbook from a colleague who does not use a consistent date format. The IF statement below outlines my thought process in trying to create a single IF statement that can convert the string or number into the proper date format by using MID and FIND:
=IF(ISTEXT(F49),MID(F49, FIND("/",F49)+1, FIND("/",F49, FIND("/",F49)+1)-FIND("/",F49)-1)&"/"&LEFT(F49,FIND("/",F49,1)-1)&"/"&RIGHT(F49,2),TEXT(F49,"dd/mm/yy"))
I am bit of a novice when it comes to VBA and wanted to create a custom function that can implement the steps outlined in the IF statement above. Any help/guidance would be greatly appreciated.
Thank you,
GG
It looks like you are converting European to local American dates. There’s several methods to do this:
a) VBA function [e.g. =ConvertDates(F49)]:
b) Sheet formula (simplified version):
c) Select the dates in the column and choose:
Data > Text to Columns > Next > Next > Column Data Format: DMY
I think the third option might be quickest as you don’t need to create a new column.