Changing date format

%3CLINGO-SUB%20id%3D%22lingo-sub-1674573%22%20slang%3D%22en-US%22%3EChanging%20date%20format%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1674573%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20getting%20my%20dates%20in%20this%20format%2C%202020-09-15%3CSPAN%3E%26nbsp%3Band%20would%20like%20to%20convert%20to%2009%2F15%2F2020%2C%20is%20there%20a%20way%20to%20do%20that.%20I%20tried%20all%20options%20I%20have%20under%20custom%20format%2C%20but%20nothing%20worked.%20I%20have%20attached%20my%20spreadsheet%20for%20you%20to%20view.%20The%20dates%20are%20in%20column%20N%20and%20O%2C%20StartDate%20labelled%20LaborDate.%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3EThanks%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1674573%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1677066%22%20slang%3D%22en-US%22%3ERe%3A%20Changing%20date%20format%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1677066%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F59469%22%20target%3D%22_blank%22%3E%40Scott%20Hetzel%3C%2FA%3E%26nbsp%3BThe%20dates%20were%20in%20fact%20texts%20and%20could%20thus%20not%20be%20reformatted.%20I%20used%20%22text-to-column%22%20to%20convert%20the%20texts%20to%20dates%20in%20a%20YMD%20format.%20Then%2C%20I%20custom%20formatted%20it%20to%20%22mm%2Fdd%2Fyyyy%22.%20See%20attached.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1677120%22%20slang%3D%22de-DE%22%3ESubject%3A%20Changing%20date%20format%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1677120%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F59469%22%20target%3D%22_blank%22%3E%40Scott%20Hetzel%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22ocpExpandoHeadTitleContainer%20x-hidden-focus%22%3E%3CSPAN%20class%3D%22tlid-translation%20translation%22%3E%3CSPAN%20class%3D%22%22%3EIf%20I%20may%20add%20...%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CP%3ECreate%20a%20custom%20date%20format%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CFONT%20size%3D%224%22%3EFormat%20a%20date%20the%20way%20you%20want%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3E%3CSPAN%20class%3D%22appliesToItem%22%3EExcel%20for%20Microsoft%20365%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22appliesToItem%22%3EExcel%20for%20Microsoft%20365%20for%20Mac%3C%2FSPAN%3E%20Excel%20for%20the%20%3CSPAN%20class%3D%22appliesToItem%22%3Eweb%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22appliesToItem%20x-hidden-focus%22%3EExcel%202019%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%222%22%3E%3CSPAN%20class%3D%22appliesToItem%20x-hidden-focus%22%3E%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-gb%2Foffice%2Fformat-a-date-the-way-you-want-8e10019e-d5d8-47a1-ba95-db95123d273e%3Fui%3Den-us%26amp%3Brs%3Den-gb%26amp%3Bad%3Dgb%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.microsoft.com%2Fen-gb%2Foffice%2Fformat-a-date-the-way-you-want-8e10019e-d5d8-47a1-ba95-db95123d273e%3Fui%3Den-us%26amp%3Brs%3Den-gb%26amp%3Bad%3Dgb%3C%2FA%3E%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%20class%3D%22ocpebw%22%3E%3CDIV%20class%3D%22ocpExpandoBody%22%3E%3CP%3EIf%20you%20want%20to%20use%20a%20format%20that%20isn't%20in%20the%20%3CSTRONG%3EType%3C%2FSTRONG%3E%20box%2C%20you%20can%20create%20your%20own.%20The%20easiest%20way%20to%20do%20this%20is%20to%20start%20from%20a%20format%20this%20is%20close%20to%20what%20you%20want.%3C%2FP%3E%3COL%3E%3CLI%3E%3CP%3ESelect%20the%20cells%20you%20want%20to%20format.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EPress%20CTRL%2B1.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EIn%20the%20%3CSTRONG%3EFormat%20Cells%3C%2FSTRONG%3E%20box%2C%20click%20the%20%3CSTRONG%3ENumber%3C%2FSTRONG%3E%20tab.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EIn%20the%20%3CSTRONG%3ECategory%3C%2FSTRONG%3E%20list%2C%20click%20%3CSTRONG%3EDate%3C%2FSTRONG%3E%2C%20and%20then%20choose%20a%20date%20format%20you%20want%20in%20%3CSTRONG%3EType%3C%2FSTRONG%3E.%20You%20can%20adjust%20this%20format%20in%20the%20last%20step%20below.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%20class%3D%22x-hidden-focus%22%3EGo%20back%20to%20the%20%3CSTRONG%3ECategory%3C%2FSTRONG%3E%20list%2C%20and%20choose%20%3CSTRONG%3ECustom%3C%2FSTRONG%3E.%20Under%20%3CSTRONG%3EType%3C%2FSTRONG%3E%2C%20you'll%20see%20the%20format%20code%20for%20the%20date%20format%20you%20chose%20in%20the%20previous%20step.%20The%20built-in%20date%20format%20can't%20be%20changed%2C%20so%20don't%20worry%20about%20messing%20it%20up.%20The%20changes%20you%20make%20will%20only%20apply%20to%20the%20custom%20format%20you're%20creating.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EIn%20the%20%3CSTRONG%3EType%3C%2FSTRONG%3E%20box%2C%20make%20the%20changes%20you%20want%20using%20code%20from%20the%20table%20below.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3C%2FP%3E%3C%2FLI%3E%3C%2FOL%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1677121%22%20slang%3D%22en-US%22%3ERe%3A%20Changing%20date%20format%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1677121%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F59469%22%20target%3D%22_blank%22%3E%40Scott%20Hetzel%3C%2FA%3E%26nbsp%3B%2C%2C%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20examined%20the%20attached%20sheet%2C%2C%20and%20got%20the%20basic%20mistake%20probably%20you%20have%20committed%2C%2C%2C%20since%20Date%20in%20column%20N%20%26amp%3B%20O%20are%20Left%20Aligned%2C%2C%20mean%20Excel%20considered%20as%20TEXT%2C%2C%2C%20perhaps%20initially%20Cell%20Format%20was%20TEXT%2C%20and%20you%20have%20entered%20the%20Dates%2C%2C%20the%20tried%20to%20apply%20the%20required%20Date%20Format%2C%2C%20and%20because%20cell%20are%20TEXT%2C%2C%20so%20that%20Excel%20has%20rejected%20the%20new%20Date%20Format.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20possible%20solution%20is%20re-write%20the%20Date%20in%20cells%2C%2C%20but%20are%20many%20so%2C%20I%20would%20like%20to%20suggest%20simple%20VBA%20Macro.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESub%20test(%20)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EApplication.ActiveWorkbook.Worksheets(%22Weekly%20Data%22).Range(%22N3%3AN322%22)%20%3D%20Format(Date%2C%20%22mm%2Fdd%2Fyyyy%22)%3CBR%20%2F%3EApplication.ActiveWorkbook.Worksheets(%22Weekly%20Data%22).Range(%22O3%3AO322%22)%20%3D%20Format(Date%2C%20%22mm%2Fdd%2Fyyyy%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEnd%20Sub%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EN.%26nbsp%3BB.%26nbsp%3B%3C%2FSTRONG%3ECheck%20the%20attached%20Workbook.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1677139%22%20slang%3D%22en-US%22%3EBetreff%3A%20Changing%20date%20format%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1677139%22%20slang%3D%22en-US%22%3EThis%20will%20not%20work%2C%20since%20date%20are%20Formatted%20as%20TEXT%2C%2C%20check%20my%20post%2C%2C%2C%20suggested%20MACRO.%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I am getting my dates in this format, 2020-09-15 and would like to convert to 09/15/2020, is there a way to do that. I tried all options I have under custom format, but nothing worked. I have attached my spreadsheet for you to view. The dates are in column N and O, StartDate labelled LaborDate. Thanks

8 Replies
Highlighted

@Scott Hetzel The dates were in fact texts and could thus not be reformatted. I used "text-to-column" to convert the texts to dates in a YMD format. Then, I custom formatted it to "mm/dd/yyyy". See attached.

Highlighted

@Scott Hetzel 

 

If I may add ...

Create a custom date format

Format a date the way you want

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2019

https://support.microsoft.com/en-gb/office/format-a-date-the-way-you-want-8e10019e-d5d8-47a1-ba95-db...

 

If you want to use a format that isn’t in the Type box, you can create your own. The easiest way to do this is to start from a format this is close to what you want.

  1. Select the cells you want to format.

  2. Press CTRL+1.

  3. In the Format Cells box, click the Number tab.

  4. In the Category list, click Date, and then choose a date format you want in Type. You can adjust this format in the last step below.

  5. Go back to the Category list, and choose Custom. Under Type, you’ll see the format code for the date format you chose in the previous step. The built-in date format can’t be changed, so don’t worry about messing it up. The changes you make will only apply to the custom format you’re creating.

  6. In the Type box, make the changes you want using code from the table below.

     

    Nikolino

     

    I know I don't know anything (Socrates)

Highlighted

@Scott Hetzel ,,,

 

I've examined the attached sheet,, and got the basic mistake probably you have committed,,, since Date in column N & O are Left Aligned,, mean Excel considered as TEXT,,, perhaps initially Cell Format was TEXT, and you have entered the Dates,, the tried to apply the required Date Format,, and because cell are TEXT,, so that Excel has rejected the new Date Format.

 

The possible solution is re-write the Date in cells,, but are many so, I would like to suggest simple VBA Macro.

 

Sub test( )

 

Application.ActiveWorkbook.Worksheets("Weekly Data").Range("N3:N322") = Format(Date, "mm/dd/yyyy")
Application.ActiveWorkbook.Worksheets("Weekly Data").Range("O3:O322") = Format(Date, "mm/dd/yyyy")

 

End Sub

 

N. B. Check the attached Workbook.

 

Highlighted
This will not work, since date are Formatted as TEXT,, check my post,,, suggested MACRO.
Highlighted

@Rajesh-S 

 

You are absolutely right, once again, has shown that first read and then write, can work wonders.

Convert dates stored as text to dates

https://support.microsoft.com/en-gb/office/convert-dates-stored-as-text-to-dates-8df7663e-98e6-4295-...

 

Thanks for the hint

 

Nikolino

I know I don't know anything (Socrates)

 

Highlighted

@Scott Hetzel 

Select column, Data->Text to Columns

image.png

On third step

image.png

Finish, dates will be as dates in your locale format.

Highlighted

@Sergei Baklan 

 

Thanks, that seemed to be the easiest, I had tried before but was selecting other in the second step, not tab.

 

Thanks so much.

Highlighted

@Scott Hetzel , you are welcome