Date in Excel

%3CLINGO-SUB%20id%3D%22lingo-sub-2381694%22%20slang%3D%22en-US%22%3EDate%20in%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2381694%22%20slang%3D%22en-US%22%3E%3CP%3EA%20coworker%20has%20a%20list%20of%20dates%20she%20needs%20to%20enter%20in%20a%20spreadsheet%20but%20she%20would%20like%20to%20type%20in%20the%20dates%20without%20typing%20the%20slash%20key%20in%20between%20the%20date%20(example%3A%20040121%20instead%20of%2004%2F01%2F21)%20and%20excel%20to%20then%20add%20them%20for%20her.%20We%20formatted%20the%20column%20to%20a%20short%20date%20but%20when%20she%20stypes%20040121%20the%20cell%20changes%20to%26nbsp%3B11%2F4%2F2009.%20Why%20is%20it%20changing%20the%20date%3F%20Is%20there%20a%20different%20way%20to%20format%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2381694%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2381760%22%20slang%3D%22en-US%22%3ERe%3A%20Date%20in%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2381760%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1061982%22%20target%3D%22_blank%22%3E%40jenniferbrookplaza%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EExcel%20never%20recognizes%20040121%20as%20the%20date%2004%2F02%2F21%20by%20itself.%20It%20requires%20VBA.%20See%20%3CA%20href%3D%22http%3A%2F%2Fwww.cpearson.com%2Fexcel%2Fdatetimeentry.htm%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EDate%20And%20Time%20Entry%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt's%20up%20to%20you%20to%20decide%20whether%20it's%20worth%20the%20hassle.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2381953%22%20slang%3D%22en-US%22%3ERe%3A%20Date%20in%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2381953%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F75890%22%20target%3D%22_blank%22%3E%40L%20z.%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%20works%20in%20the%20sense%20that%20110121%20will%20be%20displayed%20as%2011%2F01%2F21.%20But%20it%20will%20still%20be%20the%26nbsp%3B%20number%20110121%2C%20not%20a%20date%20-%20you%20cannot%20use%20functions%20such%20as%20EDATE%2C%20EOMONTH%2C%20WEEKDAY%20etc.%20with%20such%20values%2C%20at%20least%20not%20in%20a%20meaningful%20way.%3C%2FP%3E%0A%3CP%3EAnd%20it%20won't%20prevent%20the%20user%20from%20entering%20invalid%20%22dates%22%20such%20as%2065%2F43%2F21%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2381954%22%20slang%3D%22en-US%22%3ERe%3A%20Date%20in%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2381954%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F75890%22%20target%3D%22_blank%22%3E%40L%20z.%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20only%20that%20will%20be%20some%20numbers%20which%20looks%20like%20dates%2C%20not%20dates%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2382651%22%20slang%3D%22en-US%22%3ERe%3A%20Date%20in%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2382651%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%26nbsp%3B%26amp%3B%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20assumed%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1061982%22%20target%3D%22_blank%22%3E%40jenniferbrookplaza%3C%2FA%3E%26nbsp%3B%20would%20know%20how%20to%20convert%20a%20non-date%20(resulting%20of%20what%20I%20suggested)%20as%20a%20date%20value.%20I'm%20gonna%20edit%20my%20post%20with%20one%20option.%20Thanks%20for%20pointing%20this%20out%20though%3C%2FP%3E%3CP%3ERe.%20entries%20like%2065%2F43%2F21%20there's%20nothing%20we%20can%20do%2C%20even%20on%20a%20non-preformatted%20cell%3C%2FP%3E%3CP%3E(was%20just%20trying%20to%20help%20with%20a%20possible%20way%20to%20enter%20the%20data%20as%20she%20wanted)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2381913%22%20slang%3D%22en-US%22%3ERe%3A%20Date%20in%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2381913%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1061982%22%20target%3D%22_blank%22%3E%40jenniferbrookplaza%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CU%3EPre-format%3C%2FU%3E%20the%20cells%20with%20Custom%20Format%3A%20%3CSTRONG%3E00%5C%2F00%5C%2F00%3C%2FSTRONG%3E%3CBR%20%2F%3EWhen%20entering%20the%20values%20always%20use%20%3CSTRONG%3E%3CFONT%20color%3D%22%23339966%22%3Eddmmyy%3C%2FFONT%3E%3C%2FSTRONG%3E%2C%20not%20%3CSTRIKE%3E%3CSTRONG%3E%3CFONT%20color%3D%22%23FF0000%22%3Eddmyy%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FSTRIKE%3E%26nbsp%3Bnor%20%3CSTRIKE%3E%3CSTRONG%3E%3CFONT%20color%3D%22%23FF0000%22%3Edmyy%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FSTRIKE%3E%3C%2FP%3E%3CP%3E(works%20no%20problem%20here%20-%20Excel%20365)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EEDIT%3A%3C%2FSTRONG%3E%26nbsp%3BAs%20pointed%20out%20by%20Hans%20%26amp%3B%20Sergei%20the%20above%20suggestion%20doesn't%20generate%20the%20actual%20date%20values%20you%20expect.%20As%20an%20example%20entering%20010121%20will%20display%20as%2001%2F01%2F21%2C%20however%20if%20you%20reformat%20the%20cell%20with%20a%20Date%20format%20you'll%20see%20that%20the%20actual%20Date%20value%20is%2009%2F16%2F1297%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20don't%20know%20how%20to%20convert%20to%20enterred%20values%20as%20actual%20dates%2C%20one%20way%20below.%20Assuming%20the%20enterred%20values%20start%20in%20A2%2C%20in%20B2%20(or%20C2...)%20enter%20(and%20copy%20down%20as%20necessary)%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DDATE(%22%3CSTRONG%3E20%3C%2FSTRONG%3E%22%26amp%3BRIGHT(A2%2C2)%2C%20MID(TEXT(A2%2C%22000000%22)%2C3%2C2)%2C%20LEFT(TEXT(A2%2C%22000000%22)%2C2))%3C%2FP%3E%3CP%3E(adjust%20the%26nbsp%3B%3CSTRONG%3E20%3C%2FSTRONG%3E%20to%26nbsp%3B%3CSTRONG%3E19%3C%2FSTRONG%3E%20if%20the%20dates%20enterred%20by%20your%20coworker%20are%20in%2019xx)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThen%20select%20all%20cells%20in%20the%20column%20where%20you%20enterred%20the%20above%20formula%20%26gt%3B%20Copy%20%26gt%3B%20Paste%20special%20%26gt%3B%26nbsp%3B%3CSTRONG%3EValues%3C%2FSTRONG%3E.%20Finally%20delete%20column%20A%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

A coworker has a list of dates she needs to enter in a spreadsheet but she would like to type in the dates without typing the slash key in between the date (example: 040121 instead of 04/01/21) and excel to then add them for her. We formatted the column to a short date but when she stypes 040121 the cell changes to 11/4/2009. Why is it changing the date? Is there a different way to format this?

5 Replies

@jenniferbrookplaza 

Excel never recognizes 040121 as the date 04/02/21 by itself. It requires VBA. See Date And Time Entry 

It's up to you to decide whether it's worth the hassle.

@jenniferbrookplaza 

Pre-format the cells with Custom Format: 00\/00\/00
When entering the values always use ddmmyy, not ddmyy nor dmyy

(works no problem here - Excel 365)

 

EDIT: As pointed out by Hans & Sergei the above suggestion doesn't generate the actual date values you expect. As an example entering 010121 will display as 01/01/21, however if you reformat the cell with a Date format you'll see that the actual Date value is 09/16/1297

 

If you don't know how to convert to enterred values as actual dates, one way below. Assuming the enterred values start in A2, in B2 (or C2...) enter (and copy down as necessary):

 

=DATE("20"&RIGHT(A2,2), MID(TEXT(A2,"000000"),3,2), LEFT(TEXT(A2,"000000"),2))

(adjust the 20 to 19 if the dates enterred by your coworker are in 19xx)

 

Then select all cells in the column where you enterred the above formula > Copy > Paste special > Values. Finally delete column A

@L z. 

That works in the sense that 110121 will be displayed as 11/01/21. But it will still be the  number 110121, not a date - you cannot use functions such as EDATE, EOMONTH, WEEKDAY etc. with such values, at least not in a meaningful way.

And it won't prevent the user from entering invalid "dates" such as 65/43/21

@L z. 

The only that will be some numbers which looks like dates, not dates

@Hans Vogelaar & @Sergei Baklan 

I assumed @jenniferbrookplaza  would know how to convert a non-date (resulting of what I suggested) as a date value. I'm gonna edit my post with one option. Thanks for pointing this out though

Re. entries like 65/43/21 there's nothing we can do, even on a non-preformatted cell

(was just trying to help with a possible way to enter the data as she wanted)