I have a file in which the date column is three or four digits (MMYY). e.g., 411 or 1210. I want to make all dates the first of the month (since I don’t know the day) and format them as MM/01/YY. But I can’t seem to find a combination of moves that will let me do this.
For now, the solution is to copy the dates into Notebook, manually put a slash between the month and the year, change the slashes to /01/, and copy the results back into Excel. (The other solution is to sort and do several F&Rs. This is a pain because changing all of the elevens to /01/11 might result in ‘11/01/11/01/11’, for example.)
Assuming the date is in cell D4, this works for 3 or 4 digit dates:
=IF(LEN(D4)=4,CONCATENATE(“01/”,MID(D4,2,2),"/",RIGHT(D4,2)),CONCATENATE(“01/0”,MID(D4,1,1),"/",RIGHT(D4,2)))
This formula works for me. Probably something about different versions of Excel. Assuming the dates are all post-2000, this formula should work:
=DATE(2000+A1-100*TRUNC(A1/100),TRUNC(A1/100),1)