The first part of our tutorial focuses of formatting dates in Excel and explains how to set the default date and time formats, how to change date format in Excel, how to create custom date formatting, and convert your dates to another locale. Continue reading
Comments page 5. Total comments: 936
Hi Alexander,
I am getting error value with DATEVALUE(06/12/2022). Can you please suggest me.
Thanks
Hi!
The DATEVALUE function works with text. Use quotation marks. DATEVALUE("06/12/2022") See detailed instructions here: How to convert text to date and number to date in Excel.
How do I change this format mmddyyy to this format ddmmyyyy?
Hi!
All the necessary information is in the article above.
I want to change this format 02.11.2022
into 2022-11-02
=DTAE(RIGHT(A1,4),MID(A1,4,2),LEFT(A1,2))
Dear Team
How can I convert following time format through a formula 3 hr. 21 min. into 3:21 format.
Thanks in advance
Hi!
In your data, the time is written as text. Extract numbers from text as described in this tutorial: Excel substring functions to extract text from cell.
Use the TIMEVALUE function to convert text to time.
For example:
=TIMEVALUE(LEFT(A2,2)&":" & MID(A2,SEARCH(" ",A2,5),3))
IT IS WORKING VERY WELL,
THANKS A LOT
Hi guys, is it possible to change date and time format to days?
e.g.
from:
25/10/2022 0:00
to:
Day 1
and
from:
26/10/2022 0:00
to:
Day 2
Thanks
Hi!
You can only get these values using a formula if you use this instruction: Calculate number of days between two dates in Excel.
="Day "&A1-DATE(2022,10,24)
Hey Alexander! Thank you for all the nice reply for people! I am Sure you do a lot of good!
I have a problem when trying to import CSV into excel as numbers that are displayed is not the same as in the console. This is an issue as I need the number-value, but the console shows a long-date with clock aswell.
For an example:
Value: Console:
880 is 05/02/1900 16.00.00
1077 is 13/02/1900 21.00.00
1104 is 15/02/1900 00.00.00
2000 is 23/03/1900 08.00.00
Etc. Etc.
I want to get the values and stop it from avoiding giving me what's in the console. What is the issue here excactly and how do I bypass this? I tried with a xlookup, datevalue and so forth, but nothing works! It is like the numbers printed are belived to be long-date format with time. I need the Value-data as shown above, and I need some kind of formular who can convert the console-values displayed to the right above, to the values displayed to the left above.
Appreciate your help!
Hello!
Unfortunately, I cannot understand how you get such values and what console you are talking about. These dates cannot be these numbers in the Excel system. Maybe this article will be helpful: How to convert (open or import) CSV file to Excel. Or explain the problem in more detail.
How about converting this date format (when pasting from another spreadsheet) - 2022-04-13 09:58:14
I would like it to simply be short date mm/dd/yyyy, no matter how I format the cells before I paste, I always get this silly format. I don't want to have to use text to columns every time. Is it possible? It is this format in like 3 columns worth of data for all my lines. I need to be able to update this report swiftly.
Hi!
I can assume that when you insert data from another table, you get not a date, but a text. Try to use these recommendations: How to convert text to date in Excel.
Dear sir
convert date format from 29/07/1979 to date format 10.11.2021
Hi!
Please re-check the article above since it covers your task.
Hi Sir,
Need your help to provide me a formula to change below date & time which is combined as number
20220804090848 (yyyymmddHHmmss)
I need it as, dd/mm/yyyy HH:mm:ss
Thanks.
Hi!
To convert your digits to date and time, I recommend using the article: How to convert text to date and number to date in Excel.
You can use this formula:
=DATE(LEFT(A1,4), MID(A1,5,2), MID(A1,7,2)) + TIME(MID(A1,9,2), MID(A1,11,2), MID(A1,13,2))
how to change whole culom with 22/09/2022 00:00 to 09/09/2022 in excel please?
Hi!
If you want to exclude seconds from the date format, change the format as described in the article above. If you want to subtract 13 days, use these recommendations: Subtract dates in Excel; add days, weeks, months or years to date.
Hi i have text format like this 2007-May-24 00:00:0000. How can i convert this into date and time format as this 24-05-07 00:00 ? Please help
Hi!
Extract the desired strings from the text using the substring functions.
Create a date using the DATE function.
=DATE(LEFT(A1,4),MONTH(1&MID(A1,6,3)),MID(A1,10,2))
Set the cell to a custom date and time format.
Hi! Newer to excel and need help to save time please!
In one column I've entered times (about 500+rows) like this: 2105 (as in 21:05). Unfortunately, at the time creating the sheet, I did not have the knowledge or wherewithal to change the format of the column to the 24 hr format (hh:mm) and I only kept it in plain number format. So, my problem is I don't want to go and correct all 500+ entries individually. Is there a formula I can use to switch 2105 to 21:05 (plain number format to time format)?? Please? Help?
Hello!
Use the substring functions to add a time separator ":" between the numbers. Use the TIMEVALUE function to convert text to time.
The formula below will do the trick for you:
=TIMEVALUE(LEFT(A1,LEN(A1)-2)&":"&MID(A1,LEN(A1)-1,2))
Thank you!
Hi, I have a CSV file containing a column with IDs formatted as [1-1-1234] but Excel keeps changing it to the date format [m/d/yyyy]. I'm not able to import my data unless they're done with the dashes (-).
I've done the custom format to change it to [m-d-yyyy] but since it's a CSV file it doesn't save the formatting. Is there a way to change/create the default date format to have dashes (-) instead of slashes (/)?
Thank you!
Hello!
Pay attention to the following paragraph of the article above – How to change the default date and time formats in Excel. Change the date format as you need in the Region and Language panel.
22//06//2022 10:52 PM
I want change the format of Above like 22//06//2022 21:52
Hi!
Please re-check the article above since it covers your case. Remove from time format symbols AM/PM. You can learn more about time format in Excel in this article on our blog.
I looked through all of your examples several times so I am sorry if I missed the answer to my question....I am trying to change the date to 09-07-2001 from 09/07/2001. I need the mm-dd-yyyy format created but everything I am finding puts it dd/mm/yyyy
Thanks for your help
Hi!
Pay attention to the following paragraph of the article above - Creating a custom date format in Excel. Write the date format you want in the Type box.
I am trying to convert these numbers 154975.4857, & 145454.2432 from a csv file to minutes and seconds.
Hi!
I can't guess what your number means - hours, minutes, or seconds. The following tutorial should help: How to convert time to decimal number, hours, minutes or seconds. If this is not what you wanted, please describe the problem in more detail.
I have date written in the format 20181019 and i need to re-write them using slash, that is 2018/10/19.
Approximately there are 20k of these dates i need to change. How can i do this. Thanks
Hello!
The answer to your question can be found in this article: How to convert 8-digit number to date in Excel. I hope this will help.
Hii
I have multiple dates like 15/03/2020 in a SINGLE CELL but i want to change the date format as 2020-03-15
Note:- in a single cell multiple dates to be change!!
Hi!
If several dates are written in one cell, then this is text, not dates. You cannot change their format using formatting.
Hi, I've got exported data into excel and unfortunately they have the date in this text format "May 17, 2022" in the D column, and while I've been through the comments I can't find anything that converts this into a date. What would you recommend?
Thanks
Hello!
Use substring functions to extract numbers from text. Convert it to date using DATE function.
=DATE(RIGHT(D1,4),MONTH(1&LEFT(D1,3)),MID(D1,5,2))
I hope my advice will help you solve your task.
Thank you for replying. Unfortunately this returns a #VALUE
Hi!
Perhaps the problem is in the regional settings of your Windows. Try this formula
=DATE(RIGHT(D1,4),VLOOKUP(LEFT(D1,3), {"JAN",1;"FEB",2;"MAR",3;"APR",4;"May",5;"JUN",6;"JUL",7;"AUG",8;"Sep",9;"OCT",10;"NOV",11;"DEC",12},2,0),MID(D1,5,2))
You can also analyze more than 500 combinations representing dates in text format and convert them to regular Excel dates using Convert Text to Date tool. It is available as a part of our Ultimate Suite for Excel that you can install in a trial mode and check how it works for free.
Hi there,
I have hundreds of dates in a column. In this column, some dates are dd/mm/yyyy and some are mm/dd/yyyy. I am from New Zealand and require the dd/mm/yyyy format. I have tried to change the format settings of the entire column to do this.
At first, some rows were set as Armenian, and some set as English. After setting them all to English, the problem is still happening. I tried to read through most of your advice and comment replies but I got a wee bit confused and thought it best to just ask!
Hello!
Some of your dates are written as text. This text should be converted to a date. Set the cells to the desired date format and use the formula:
=IF(ISTEXT(A1),DATE(RIGHT(A1,4),LEFT(A1,SEARCH("/",A1)-1),MID(A1,SEARCH("/",A1)+1,SEARCH("/",A1,4)-SEARCH("/",A1)-1)),A1)
I recommend reading this guide: How to convert text to date in Excel
My hundreds of dates are entered with an abbreviation at the end of the day i.e. 22nd March 2022 and it hasn't accepted any of the normal ways of changing the format to 22/03/2022 - I know the 'nd' is causing the problem but can't figure my way around it - any help?
Hello!
Remove extra characters from text and convert to date using DATEVALUE function:
=DATEVALUE(LEFT(A1,SEARCH(" ",A1)-3)&MID(A1,SEARCH(" ",A1),30))
Set the date format you need in the cell as described in the article above.
Thank you SOOOOO MUCH it worked a treat and has saved me so much time :)
Difference between two dates with time to collect time difference between two dates for example Wed Apr 20 17:56:16 IST 2022 & Wed Apr 20 17:53:43 IST 2022 Please give answer with formula not manually because I have 30000 entries for work. Please help if any
Hello!
You can find the examples and detailed instructions here: Excel DATEDIF - calculate difference between two dates in days, weeks, months or years.
I hope my advice will help you solve your task.
Excel stopped recognizing the Spanish date formats, it was working from January til March then it just stopped working during April.
Example:
Using VLOOKUP and 01 abr. as a reference, it doesn't count "01 abr" from the raw data.
This worked from Jan to Mar using the same "everything". I just changed the month.
Hello!
The date format does not affect its value. What formula are you using?
"abr" or "apr"?
Insanely simple, thank you
I want to input 20032022 then excel will convert it to 20-Mar-2022. what is the custom format for that?
Hello!
You can find the examples and detailed instructions here: How to convert 8-digit number to date in Excel.
This should solve your task.
how can Jan-2021 be read as January 2021 instead of being a text
Hi!
If I understand you correctly, use a custom date format as described in the article above -
mmmm yyyy
how to change 02.01.2022 to 02/01/2022?
Hi!
Use a custom date format as described in the article above.
dd/mm/yyyy
Monday, February 21, 2022
CONVERT IN 02-21-2022
FORMULA USING TEXT(RIGHT(N1044,LEN(N1044)-FIND(",",N1044)-1),"mm-dd-yyyy")
BUT AFTER RESULT February 21, 2022
I NEED CONVERT IN 02-21-2022
Hi!
We have a ready-made solution for your task. Our Text to Date tool allows you to convert text to normal Excel dates.
I have date in format Feb-21, Mar-21 & so on till Jan-22. While converting this to year I am not able to do that, I am using formula Year it shows me a result 2022 for 2021 as well. Also, I am not able to convert it to date. Please help.
Hello!
Look closely at what date format is set in the cell. To do this, press CTRL+1. I think your date format is "mmm-dd".
Feb-21 means 21 February 2022.
Hi, I use mmmm or dddd and I get always fmonth or day names in small letters, but I would like that first letter is big just like Thursday but i get thursday. I use estonian language and may bet that is reason why all letters.
Hello!
Pay attention to what custom date format is set in this cell. If there is something like
[$-F419]dddd, d mmmm yyyy
then delete the regional settings [$-F419].
I hope it’ll be helpful. If something is still unclear, please feel free to ask.
Hello! and thank you for your replay but my problem are that all months and days of the week are in lower case (small letter). I put 1.04.2022 and Format Cells>NUmber>Custom I put mmmm because I would like to see only month or some other place weekday and result always I get april or monday not what i want April or Monday . I would like to see that first letter is big /upper. If I use formula =upper(a1) then all letters will be APRIL but I want that first letter is only upper
Hi!
I can't repeat your problem as it is related to the regional settings of your computer and your Excel. Try to use PROPER function to capitalize the first letter.
That formula and 1.04.2022 will be Aprill
=UPPER(LEFT(TEXT(A1;"mmmm");1))&""&LOWER(RIGHT(TEXT(A1;"mmmm");LEN(TEXT(A1;"mmmm"))-1))
but is there a simpler method
Is there a way to save custom formatting to a named option in the Date list
Hello, I need to change a bunch of dates formatted like this: 2021-10-02, 1:47:40 PST
to 10/02/2021. What formula can I use? Thanks.
Hello!
You can use the DATE function:
=DATE(LEFT(A1,4),MID(A1,6,2),MID(A1,9,2))
I hope my advice will help you solve your task.
So i have a question if my date format reads as 01/02/2022 = Jan 2,2022 which is wrong because the month should be February is the a formular to correct such ?
Hello!
Problems in your Windows regional settings. I recommend reading this guide: How to change the default date and time formats in Excel.
Hi - thank you for this very nice article :-)
I am puzzled by this observation in my company: If I create a new workbook and enter in the same date (I type it in as "dd/mm") in three different cells and then;
1: do nothing
2: specify a custom format "dd-mm-yyyy" (typical Danish format)
3: specify a custom format "mm/dd/yyyy" (typical US format)
Then my first question is: why does the first cell display as "dd-mmm"? Or rather - why is the default cell format for date entries a custom format of "dd-mmm". Shouldn't it rather be the deafult Windows regional settings format ? If I want to change it, so going forward then my new spreadsheets just use the default Windows format - how can I do that.
Secondly : when I send this spreadsheet by e-mail to a colleague in the US, then the date in the second cell (Danish format) is changed so it appears the same as in cell 3 (the US format). If I go to the trouble of enforcing a specific / custom format, then I would have assumed that this would be respected, even if it is send to another Excel user. Why is this not the case and is there anything I can do to enforce a particular date format, without having to actually enter in dates as text (or use formuals and stuff)?
Br,
Kim
First questions:
"Shouldn't it rather be the deafult Windows regional settings format?"
There is no date format in windows regional settings, OOXML standard nor ISO 8601 formats without the year specified, so it seems to be a free interpretation/guess from excel where it transforms it to a date (with current year) but display just the information provided. I didn't fint documentation about it.
"... how can I do that."
If you add the year (at least yy) to the date, then it generally autoformats to your short date format regional setting. I didn't find a way for auto-transforming dd/mm to short date regional format though.
Second questions:
"... is there anything I can do to enforce a particular date format?"
Add ";@" at the end, for example: "dd-mm-yyyy;@"
"¿Why is this not the case...?"
There is a list of number formats which their corresponding format code can change depending on the format settings of your operative system. Some, but not all, of these format codes are the ones with * mentioned in this article as Default date format; and "dd-mm-yyyy" with your regional settings is another one.
When you use a format code that matches one of these format codes, excel saves its Id (numFmtId) but not the actual formatCode that your excel is displaying. So, when reading the file with another regional settings, excel could interpret it with a different formatCode.
If your regional setting for short date is "dd-MM-yyyy" (default for Danish-Denmark), then the excel formatCode "dd-mm-yyyy" is associated with numFmtId 14 and it saves just that Id. When your friend opens the file, excel would interpret the numFmtId 14 according to his format settings (which should be m/d/yyyy for English-USA).
https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.spreadsheet.numberingformat
Pls am having a problem with a date column. Some entries are showing datetime including PM and AM while others only show dates, but when I click on them it appears as both the date, time and PM on the formula tab. Pls how can i display just the dates. I don't need the time nor the PM or AM
Hello!
Select cells and set the date format you need in them as described in the article above.
Hi,
I want to update the format of ONLY date values from particular column which has all types of data values.
Thanks,
Riyaz
Hello!
Use conditional formatting based on cell value. You can use this condition to conditionally format the cell
=LEFT(CELL("format",A1))="D"
You can learn more about CELL function in Excel in this guide.
I am past some 1-2,2-4...like this it will show 1-feb-2021,2-Apr-2021 how can slove entire cell one time pls give mee reply
Hi!
What you want to do is impossible because you write some text in the cell, not the date.
Hi
I find a way to convert Gregorian date to another (e.g. persian calender) format, but what about if I want to convert persian calender into Gregorian (or other formats)??
Hello, I am going crazy here... I am using Excel in a MacBook Pro, version 16.56. My problem is the following: I have a data table where in the first column I register a list of dates by the exact day when a sale has occurred and in the next column I register the amount of that sale. Now I want to create a bar chart that groups all these dates into months to show me the 12 totals of the monthly sales throughout the year, where the x-axis is the 12 months of the year, and the y-axis is the amount of the sales. Now, once I want to label the bar charts, instead of getting the total sales amount for a specific month, I get a label for each date of each sale. Basically the bar is composed of many bars stacked one on top of the other for each date, instead of being just the sum of the sales for that specific months as it should be. The result is I cannot get a label with the total monthly sales amount, by I get numerous labels inside the monthly bar chart labelling the amount of the sale for each date where that sale has occurred. Please somebody help me!
Hello!
A histogram cannot group and sum your data. You need to calculate the total sales by month. Use a pivot table or the SUMIFS function to do this.
Thank you, ok understood, I feared that, although it surprises me such a task is not performed by excel without having to do extra work to group the sales by month as well ;(
dd-mm-yyyy hh:mm i want this date format in my all workbooks.. is there any way to set his globally ?
Hello!
The short and long date formats are retrieved from Windows Regional Settings. Open Windows Settings - Time & Language - Region - Change Data formats
How would I go about formatting a column that has the information in years as dates. Since it is currently in the general number format I am unable to insert a timeline slicer. I have tried using the custom yyyy date but it converts all the dates to 1905
Hello!
Check if your dates are actually written in cells as dates. Perhaps it is text or ordinary numbers.
How to keep the same format date of excel in CSV file?
Because, when I converting a file from excel to CSV format. I noted some of the dates have changed from MM/DD/YYYY into DD/MM/YYYY. I wanted to keep the same data as MM/DD/YYYY.
Appreciate your help. Thank you
Hello!
CSV is a plain text file. No formats are possible there. Try changing the system date format before converting.
Hi! Could you please help us on how will we able to change the format from this day "Thu Oct 28 09:42:08 PDT 2021" to "MM/DD/YYYY" format only
Appreciate your help!
Hello!
All recommendations on how to change the date format are described above in this article. If your date is written as text, then I recommend this guide: Convert text to date in Excel.
Please try the following formula:
=DATEVALUE(MONTH(1&MID(A1,5,3))&"-"&MID(A1,9,2)&"-"&RIGHT(A1,4))
I could get what I want by dividing 365.25 by 12 then dividing the difference of the dates by the result of the division. Any other better way?
Hi!
What do you want to get? I cannot guess.
I have an issue to replace date of day to start day of every date "Example" 19/4/2021 - 24/1/2021 - 27/8/2021 need to be change date of every example to be 1/4/2021 - 1/1/2021 - 1/8/2021 " is there any formula please to change the day of the date?
Thanks for your support
Hello, Please help,
I want to calculate age in months and not in years between two dates, for example 15/01/2020 23/11/2021 1.86 years =(B1-A1)/365.25, this formula is used to calculate age in years. But I want the age to be in months and with two decimal places.
Hi!
You can find the examples and detailed instructions here: Calculate the difference between two dates in days, weeks, months or years.
To convert days to tenths of a month, divide by 30.
I hope I answered your question. If something is still unclear, please feel free to ask.
I have some dates in this format. 13-01-1992. I want to be able to change to yyyy-mm-dd format in excel. I have tried changing from the format cells/custom format. but it does not seem to change. is there any formula you might know that can change ?
thanks in advance
Hello!
I'm assuming your dates are written as text. Use these guidelines to convert this text to a date.
I hope I answered your question. If you have any other questions, please don’t hesitate to ask.
I have been able to pull the day (as text) from a date in another field (ex: 27 from 27 Sep 21) using TEXT(DAY(cell),"00").
However, for my application, I would also like to be able to add another number to the day portion for scheduling purposes. For example, a single schedule for 27 Sep 21 would show as "727", but I would like to add 30 or 60 to show other scheduled activity for that day (to be shown as "757" and "787" respectively).
What is the best way to accomplish this?
The original formula is: If(MONTH(A36)=9,"7"&TEXT(DAY(A36),"00"),"")
Hello!
You can simply add 30 to your formula.
=IF(MONTH(A36)=9,"7"&TEXT(DAY(A36),"00"),"")+30
If the result is as text -
=(IF(MONTH(A36)=9,"7"&TEXT(DAY(A36),"00"),"")+30)&""
Hope this is what you need.
one cell Take 7 Numeric Value For example (1112021). How to change Date formate.
but which date is correct its (01-11-2021) or (11-01-2021) ?
Pls Kindly send formula.....
Hi!
You can see the correct date format in the regional settings of your Windows.
Hi sir,
need your support to change the date format as below pasted date format not correct and not complete.
09/17/21 15:53:42
i want like 17/09-2021 15:53:42
Hi!
I hope you have studied the recommendations in the tutorial above. Replace in date format symbol / on -.
Hi, How to convert 01-JUN-18 12.25.13.031000000 AM into 00:25:13 as the string is in AM. Also, how I convert the same string to time format in PM i.e. 12:25:13. Can someone help me with a formula with AM and PM?
Hi!
If I understand your task correctly, the following formula should work for you:
=LEFT(A2,SEARCH(" ",A2,1)) + SUBSTITUTE(LEFT(SUBSTITUTE(MID(A2,SEARCH(" ",A2,1)+1,100),".","#",3), SEARCH("#",SUBSTITUTE(MID(A2,SEARCH(" ",A2,1)+1,100),".","#",3),1)-1) & RIGHT(A2,3),".",":")
I will try the formula and update. Thanks Already.
Hi Alex,
I applied the formula. It gives correct time. But when I compare to 12:25:10 AM i.e. 01-JUN-18 12.25.10.031000000 AM it gives a difference of 23:59:57 which is too huge difference to consider.
I tried with another formula before:
=(SUBSTITUTE(MID(A2,11,8),”.”,”:”)+IF(AND(MID(A2,11,2)”12”,RIGHT (A2,2)=“PM”),0.5,0))+TIME (4,0,0)
The difference from other timestamps are good. Like for above example, I get 00:00:03.
Only, issue is with the formula is, it doesn’t identify 12:00:00 AM as 00:00:00 but identifies 12:00:00 PM as 12:00:00.so, I requested for a suggestion. Any update on the details would be helpful. Thanks already.
Hello!
12:00 am and 12:00 pm are shown differently in different countries. Excel defines 12:00:00 PM as 12:00:00 according to the international standard ISO 8601.
I am trying to find difference between
21-08-24 03:02:54 and 24-AUG-21 03.00.47.059641000AM. I have added time(4,0,0).
I converted as 7:02:54 AM and 7:00:47 AM. When I subtract as per the above formula, it gives a difference of 23:57:53.
When I convert the timestamps to number, it is 0.29 and 44432.29. I believe, the second number is counting the date also, that’s why making difference too huge. How can I resolve this? As difference should show as 0:02:07. Please suggest.
Thank you for the time and effort Alex.
To convert the 24-AUG-21 03.00.47.059641000AM, I have applied
=LEFT(A2,SEARCH(" ",A2,1)) + SUBSTITUTE(LEFT(SUBSTITUTE(MID(A2,SEARCH(" ",A2,1)+1,100),".","#",3), SEARCH("#",SUBSTITUTE(MID(A2,SEARCH(" ",A2,1)+1,100),".","#",3),1)-1) & RIGHT(A2,3),".",":")
Then for difference, I have applied =MAX(A2::B2)-MIN(A2:B2)
Some, results for other timestamps are correct but some shows huge difference like above. How I can rectify this issue?
Hi!
If the formula shows the correct result for some data, then the formula is correct. I think that in some cells the data is written differently. Therefore, the result is wrong. Check the data. I can't help you anymore.
No, both are 24 aug 2021. It’s just formats are different. I am subtracting 07:02:54 - 07:00:47.
Hi!
The time difference 07:02:54 - 07:00:47 is equal to 0:02:07. How did you get the time 23:57:53?
Hi!
Explain what you are subtracting and what formula you are using. You cannot subtract 7:02:54 AM from 7:00:47 AM. Negative times are not possible. If from date 8/24/2021 3:00:47 subtract 8/21/2024 3:02:54 we get 2 days 23:57:53