SOLVED

Insane date formatting problem

%3CLINGO-SUB%20id%3D%22lingo-sub-2148170%22%20slang%3D%22en-US%22%3EInsane%20date%20formatting%20problem%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2148170%22%20slang%3D%22en-US%22%3E%3CP%3EHi!%26nbsp%3B%20So%20I'm%20having%20an%20odd%20issue%20with%20Excel.%26nbsp%3B%20I%20have%20a%20column%20formatted%20as%20dates.%26nbsp%3B%20I've%20tried%20the%20%22Text%20to%20columns%22%20solutions%20for%20date%20problems.%26nbsp%3B%20I've%20customized%20the%20way%20the%20date%20is%20supposed%20to%20display.%26nbsp%3B%20I%20still%20am%20having%20this%20problem%20and%20I%20can't%20seem%20to%20find%20an%20online%20solution%20to%20it.%26nbsp%3B%20I%20have%20this%20spreadsheet%20made%20up%20for%20paying%20my%20bills.%26nbsp%3B%20It's%20a%20very%20simple%20spreadsheet%2C%20and%20after%20I%20pay%20a%20bill%2C%20I%20change%20the%20date%20of%20the%20bill%20to%20the%20next%20payment%20date%20for%20the%20following%20month.%26nbsp%3B%20For%20the%20most%20part%2C%20this%20spreadsheet%20works%20great.%26nbsp%3B%20In%20just%20a%20couple%20of%20cases%20though%2C%20the%20date%20will%20NOT%20format%20properly%2C%20and%20thereby%20will%20not%20sort.%26nbsp%3B%20I%20enter%20dates%20by%20typing%20%223-13-21%22%20or%20whatever%20date.%26nbsp%3B%20It%20then%20always%20formats%20it%20to%20%2203-13-2021%22%20and%20allows%20it%20to%20be%20sorted.%26nbsp%3B%20Today%20I%20entered%20%222-31-21%22%20and%20it%20left%20it%20exactly%20that%20same%20way%2C%20and%20refuses%20to%20sort%20it.%26nbsp%3B%20I've%20tried%20copying%20cells%20that%20weren't%20doing%20that%20to%20this%20cell.%26nbsp%3B%20I've%20tried%20copying%20empty%20cells%20to%20this%20cell.%26nbsp%3B%20I've%20tried%20opening%20brand%20new%20workbooks%20and%20typing%20in%20this%20number%20and%20formatting%20it%20from%20scratch.%26nbsp%3B%20Nothing%20I%20do%20seems%20to%20change%20this%20into%20a%20recognized%20date.%26nbsp%3B%20None%20of%20the%20text%20to%20columns%20solutions%20I've%20found.%26nbsp%3B%20So%20what%20am%20I%20doing%20wrong%3F%26nbsp%3B%20Its%20probably%20something%20really%20stupid%20and%20simple.%26nbsp%3B%20But%20I'm%20growing%20frustrated%20trying%20to%20figure%20it%20out.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2148170%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2148340%22%20slang%3D%22en-US%22%3ERe%3A%20Insane%20date%20formatting%20problem%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2148340%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F971711%22%20target%3D%22_blank%22%3E%40bobthemackerel%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheck%20the%20attached%20file%2C%20and%20read%20the%20instruction%20as%20well%20comment%20I've%20created%2C%2C%20in%20case%20this%20doesn't%20solves%20the%20issue%2C%2C%20share%20original%20WB%20with%20us.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2148347%22%20slang%3D%22en-US%22%3ERe%3A%20Insane%20date%20formatting%20problem%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2148347%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F971711%22%20target%3D%22_blank%22%3E%40bobthemackerel%3C%2FA%3E%26nbsp%3BI%20believe%20the%20problem%20lies%20in%20the%20fact%20that%20you%20are%20trying%20to%20enter%20a%20non-existing%20date.%20There%20is%20no%20such%20date%20as%20February%2031%2C%202021.%20Excel%2C%20thus%2C%20does%20not%20recognise%20it.%20Try%202-28-21%20and%20it%20will%20work.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2148366%22%20slang%3D%22en-US%22%3ERe%3A%20Insane%20date%20formatting%20problem%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2148366%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F93699%22%20target%3D%22_blank%22%3E%40Rajesh-S%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20appreciate%20your%20suggestion%2C%20but%20it%20turns%20out%20that%20wasn't%20the%20problem.%26nbsp%3B%20If%20you%20go%20into%20any%20of%20the%20other%20dates%20for%20the%20other%20items%20listed%20and%20type%20in%20the%20date%20in%203-10-21%20format%20it%20automatically%20changes%20it%20to%20the%20correct%20date%20formatting.%26nbsp%3B%20While%20your%20solution%20wasn't%20actually%20the%20issue%2C%20it%20did%20lead%20me%20to%20think%20about%20the%20problem%20in%20a%20more%20obvious%20way.%26nbsp%3B%20The%20reason%202-31-21%20didn't%20automatically%20turn%20into%20a%20date%2C%20is%20because%20there%20is%20no%20such%20date.%26nbsp%3B%20There%20are%20at%20best%2029%20days%20in%20February%2C%20but%20this%20year%20only%2028.%26nbsp%3B%20So%20when%20I%20enter%202-28-21%20into%20those%20slots%2C%20it%20appears%20just%20as%20it%20should%20in%20the%20date%20format.%26nbsp%3B%20I%20have%20to%20assume%20Excel%20knows%20the%20year%20and%20knows%20that%20there's%20only%2028%20days.%26nbsp%3B%20I%20confirmed%20this%20by%20typing%20in%203-32-21%20and%20it%20didn't%20format%20it%20as%20a%20date%20either.%26nbsp%3B%20The%20solution%20was%20so%20simple%20and%20staring%20me%20in%20the%20face%20the%20entire%20time.%26nbsp%3B%20When%20I%20was%20changing%20my%20due%20dates%2C%20I%20always%20just%20changed%20the%20month%20and%20left%20the%20day%20the%20same.%26nbsp%3B%20Thanks%20for%20your%20assistance%20though!%20%3A%20)%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi!  So I'm having an odd issue with Excel.  I have a column formatted as dates.  I've tried the "Text to columns" solutions for date problems.  I've customized the way the date is supposed to display.  I still am having this problem and I can't seem to find an online solution to it.  I have this spreadsheet made up for paying my bills.  It's a very simple spreadsheet, and after I pay a bill, I change the date of the bill to the next payment date for the following month.  For the most part, this spreadsheet works great.  In just a couple of cases though, the date will NOT format properly, and thereby will not sort.  I enter dates by typing "3-13-21" or whatever date.  It then always formats it to "03-13-2021" and allows it to be sorted.  Today I entered "2-31-21" and it left it exactly that same way, and refuses to sort it.  I've tried copying cells that weren't doing that to this cell.  I've tried copying empty cells to this cell.  I've tried opening brand new workbooks and typing in this number and formatting it from scratch.  Nothing I do seems to change this into a recognized date.  None of the text to columns solutions I've found.  So what am I doing wrong?  Its probably something really stupid and simple.  But I'm growing frustrated trying to figure it out.  

8 Replies

@bobthemackerel 

Check the attached file, and read the instruction as well comment I've created,, in case this doesn't solves the issue,, share original WB with us.

Best Response confirmed by bobthemackerel (New Contributor)
Solution

@bobthemackerel I believe the problem lies in the fact that you are trying to enter a non-existing date. There is no such date as February 31, 2021. Excel, thus, does not recognise it. Try 2-28-21 and it will work.

@Rajesh-S 

I appreciate your suggestion, but it turns out that wasn't the problem.  If you go into any of the other dates for the other items listed and type in the date in 3-10-21 format it automatically changes it to the correct date formatting.  While your solution wasn't actually the issue, it did lead me to think about the problem in a more obvious way.  The reason 2-31-21 didn't automatically turn into a date, is because there is no such date.  There are at best 29 days in February, but this year only 28.  So when I enter 2-28-21 into those slots, it appears just as it should in the date format.  I have to assume Excel knows the year and knows that there's only 28 days.  I confirmed this by typing in 3-32-21 and it didn't format it as a date either.  The solution was so simple and staring me in the face the entire time.  When I was changing my due dates, I always just changed the month and left the day the same.  Thanks for your assistance though! : ) 

@Riny_van_Eekelen 

You got it!  You were replying just as I was realizing what a dope I was. : ) 

@bobthemackerel 

 

While entering in cells Excel never checks that how may days falling in month particular or whether moth exceeds 12 or not,,, unless any validation rule has not been applied,,, otherwise I would  have get Error in cells B24,, where cell format is mm/dd/yyyy,,,, and the value is 02/31/2021,,the date have been accepted !!. 

 

BUT if you apply this formula =DATE(YEAR(B24),MONTH(B24),DAY(B24)+2) ,, then you get #VALUE! error !!

 

If you wanna check whether entered date is valid by Month & Days or not the you may use this,, =ISERROR(DATE(DAY(B24),MONTH(B24),YEAR(B24))) you get TURE for invalid and FALSE for valid date.

@Rajesh-S Not sure what you are getting at, but your "date" in B24 is, in fact, a text. You didn't get an error because "02/31/2021" is a valid text, just like "ABC123". Enter that in B24 and you won't get an error either, despite the fact that you formatted the cell as a date.

 

The #VALUE! error occurs because you can't use a date function (like YEAR, MONTH, DAY) on a cell that is not a date. As you know, dates are stored as numbers. Try this:

=ISNUMBER(B24)

and you will get FALSE. B24, therefore, does not contain a date. And as explained earlier, the 31st of February is never going to be recognised as a date. No matter how you format it.

@Riny_van_Eekelen 

Check the attached file & cell B25, B25 the date value are not TEXT,,, since Right aligned, as well has CUSTOM format.

 

What I was trying to say while entering Excel doesn't check whether Data value is valid or not unless any validation rule has not been applied,, but as soon formula applied the Excel checks the validity.

 

In B24 if you enter 02/29/2021 then also get the #VALUE! error ,, coz this year Feb has 28 days only, and try to enter 02/28/2021 or any valid date, then in C24 you find formula is working, and the same U may try in B25 also!!

 

 

@Rajesh-S ???