I want to change the default format of dates in excel sheets to follow a format that is 'yymmdd'. I dont want to include any slashes periods or dashes to separate the elements of the date. For example the 14th of May 2022, would simply be displayed as 220514.
The problem I'm running into is that excel sees me entering 220514 as a number and converts it to a date using its own method of adding the number I enter to the default start date of 01/01/1900. If I manually change the date in the formula bar to what I want it to be, it will display correctly, but this wont be feasible if I have to enter a large amount of data. If I enter the date in a format with slashes (22/05/14) it also works, but I want to avoid having to do that if possible. Is there a workaround for this?
I have used a previous version of Excel and OpenOffice Calc, and I was able to format dates to the Ukrainian format "dd.mm.yy" so that when I typed for example "1.8" in the cell marked with this format, it correctly read it as "01.08.22" (the first of August of the current year). Now I'm using the newest Excel and for some reason when I type in "26.08", it autocompletes as "26.01.00" with the following in the formula section: "1/26/1900 12:14:24 AM". Now I could understand not filling in the year I want it to, but not even the month?
And when I do fill it in fully, I don't think it recognizes the text as a date at all! The dates filled in previously in the same document are interpreted and formatted correctly, but not the new ones. The format is identical, I formatted the whole range of cells together.
Typing "8/26" gives me the desired date, but it's not my regional format and it's inconvenient to use.
Is there a way to make Excel do what I want, here?
I am trying to link two Excel files and compare the values from first one in the second one, but I have a problem at some point.
So the date 28/07/2021 comes from the other file (which is call 3WLA). I had to use the function TEXT(..., "dd/mm/yyyy") otherwise it displays 44405 which is an other form of the date. Now I want to compare this date with other ones but it doesn't work as showed in the pictures below.
The picture shows the comparison of two dates coming from the other excel file 3WLA (still using the function TEXT(..., "dd/mm/yyyy")). We clearly see that there is a problem as it should display TRUE. In the same way, when I compare a date from 3WLA (i.e. using TEXT(..., "dd/mm/yyyy")) with a date random in my file it give me the following
where 28/07/2021 is given by = TEXT('[3WLA.xlsx]Block-First-Fix'!$AM$1,"dd/mm/yyyy") and 29/07/2021 by = 29/07/2021
chris neilsen already gave you the answer in the comments.
To clarify further: The text "29/07/2021" and the date formatted to look like "29/07/2021" are different data types. To help with this MS Excel automatically formats numbers and dates to be aligned to the right and normal text to be aligned to the left
In B1 you can see that the date has been formatted in the same way as per the formula in A2, but since the output in B2 is of the text data type, the two are not considered the same.
You can use the formula DATEVALUE to convert from text to date serial number. (Read more about date serial numbers here).
If your texts with dates are too different from your local settings date formats, DATEVALUE might not give you correct results. In that case use DATE function in combination with some text functions such as LEFT, MID, RIGHT
You can format the cell to make the date more readable using either the number formatting field or the dropdown from the ribbon
I am working in software. From that I got out put as .CSV format file. Now I need to convert that .CSV file in to Excel 2007 and then I have to use that file. In that I have Previous Month date and Current month date. For example I am working for May month means the date is 13/05/2013 this is the standard format, but in some cells I found the format changed to 3/5/2013 (05-Mar-13) But it should be 5/3/2013.
How to change this - any formula or formatting?
Instead of double-clicking on the .csv file try Data > Get External Data - From Text, Import and at Step 3 of 3 format Date to suit.
Edit Attempt at clarification
I am a little confused by the OP’s comment here (it is not working when coupled with the green tick) and not quite sure whether DMY or MDY is required output but given the source as in ColumnA, then importing with DMY gives ColumnB (after formatting) and with MDY gives ColumnC (after formatting). Both Columns B and C in General format appear as numbers (B5 as 41338 and C5 as 412397 – vice versa in Row6).
If say 1/4/13 is April 1st and 1/5/13 is 5th January then I see no solution given the data presently available. The normal problem is where Excel has a default setting such that 6/7/13 converts to July 6th for a date that is supposed to be June 7th, because the same setting can’t cope with 10/21/13 (there is no ‘month 21’). Hence some dates are left as strings, some converted (incorrectly) and only some correctly (1/1, 2/2 etc are no problem).
Here is a list of dates:
04-22-11
12-19-11
11-04-11
12-08-11
09-27-11
09-27-11
04-01-11
When you copy this list in Excel, some of them are recognized as dates, others not, in the following manner:
04-22-11
12-19-11
11-04-11 (date)
12-08-11 (date)
09-27-11
09-27-11
04-01-11 (date)
Does anyone know why? And how to force Excel to recognize all list items as dates?
Many thanks!
It is caused by Excel auto-recognizing/formatting the cell contents, but in unclear/inconsistent ways.
Fixing it is not that hard...
Check out this forum post:
http://www.pcreview.co.uk/forums/excel-not-recognizing-dates-dates-t3139469.html
The steps in short:
Select only the column of "dates"
Click Data > Text to Columns
Click Next
Click Next
In step 3 of the wizard, check "Date" under Col data format, then
choose: "DMY" from the droplist.
Click Finish
This is caused by the regional settings of your computer.
When you paste data into excel it is only a bunch of strings (not dates).
Excel has some logic in it to recognize your current data formats as well as a few similar date formats or obvious date formats where it can assume it is a date. When it is able to match your pasted in data to a valid date then it will format it as a date in the cell it is in.
Your specific example is due to your list of dates is formatted as "m/d/yy" which is US format. it pastes correctly in my excel because I have my regional setting set to "US English" (even though I'm Canadian :) )
If you system is set to Canadian English/French format then it will expect "d/m/yy" format and not recognize any date where the month is > 13.
The best way to import data, that contains dates, into excel is to copy it in this format.
2011-04-22
2011-12-19
2011-11-04
2011-12-08
2011-09-27
2011-09-27
2011-04-01
Which is "yyyy-MM-dd", this format is recognized the same way on every computer I have ever seen (is often refered to as ODBC format or Standard format) where the units are always from greatest to least weight ("yyyy-MM-dd HH:mm:ss.fff") another side effect is it will sort correctly as a string.
To avoid swaping your regional settings back and forth you may consider writting a macro in excel to paste the data in. a simple popup format and some basic logic to reformat the dates would not be too difficult.
In your case it is probably taking them in DD-MM-YY format, not MM-DD-YY.
The quickest and easiest way to fix this is to do a find and replace on your date seperator, with the same separator.
For example in this case Find "-" and Replace with "-", not sure why this works but you will find all dates are right-aligned as they should be after doing this.
Here is what worked for me. I highlighted the column with all my dates. Under the Data tab, I selected 'text to columns' and selected the 'Delimited' box, I hit next and finish. Although it didn't seem like anything changed, Excel now read the column as dates and I was able to sort by dates.
The simplest solution is to put yy,mm,dd into the date() formula by first extracting them with left(), mid() and right(). In this case, assuming your input date is in A1:
=date(right(A1,2)+100,left(A1,2),mid(A1,4,2))
Explanation of above:
=right(A1,2) gets the last two digits in the cell (yy). We add 100 because it defaults to 1911 instead 2011 (omit +100 if it doesn't do that on yours)
=left(A1,2) gets the first two digits in the cell (mm).
=mid(A1,4,2) gets 2 digits in the middle of the cell, starting at 4th digit (dd).
Why this happens in the first place:
I come across this problem all the time when I import Canadian bank data into excel. In short, your input date format does not match your regional settings.
Seems your setting mean Excel wants date input as either DD-MM-YY or YY-MM-DD, but your input data is formatted as MM-DD-YY.
So, excel sees your days as months and vice-versa, which means any date with day below 12 will be recognized as a date, BUT THE WRONG DATE (month and day reversed) and any date with day above 12 won't be recognized as a date at all, because Excel sees the day as a 13th+ month.
Unfortunately, you can't just change the formatting, because Excel has already locked those day/month assignments in place, and you just end up moving what Excel THINKS are days and months around visually, not reassigning them.
Frankly, it is surprising to me there is not a date-reverse tool in excel, because I would think this happens all the time. But the formula above does it pretty simply.
NOTE: if your dates don't have leading zeros (i.e. 4/8/11 vs 04/08/12) it gets trickier because you have to extract different amounts of digits depending on the date (i.e. 4/9/11 vs 4/10/11). You then have to build a couple if statements in your formula. Gross.
Here is what worked for me on a mm/dd/yyyy format:
=DATE(VALUE(RIGHT(A1,4)),VALUE(LEFT(A1,2)),VALUE(MID(A1,4,2)))
Convert the cell with the formula to date format and drag the formula down.
Right-click on the column header and select Format Cells, the chose Date and select the desired date format. Those that are not recognized are ambiguous, and as such not interpreted as anything but that is resolved after applying formatting to the column. Note that for me, in Excel 2002 SP3, the dates given above are automatically and correctly interpreted as dates when pasting.
A workaround for this problem consists in temporarily changing your regional settings, so the date format of the CSV imported file "matches" the regional settings one.
Open Office seems to work in a similar way for that issue, see: http://www.oooforum.org/forum/viewtopic.phtml?t=85898
I come across this problem when I tried to convert to Australian date format in excel. I split the cell with delimiter and used the following code from split cells then altered the issue areas.
=date(dd,mm,yy)