How to fix dates in a spreadsheet: numbers, wrong and mixed formats
By the MyDataFixer team · Updated
The short answer
If a date shows as a number like 45292, it is a real date in the wrong format: change the cell format to Date. If one column mixes styles like 2024-03-15 and 15/03/2024, convert them all to one style. And if a date like 03/04/2024 could mean two things, check the source before changing it.
How spreadsheets store dates
Excel and Google Sheets store every date as a number: the number of days since the start of 1900. 1 January 2024 is day 45292. This is what lets you subtract dates, sort them and count days between them. What you see on screen, such as 01/01/2024, is just a format laid over that number.
Problems start when the format is lost, or when a date is saved as text instead of as a real date. A text date looks right, but Excel can't sort it, filter it by month or use it in calculations.
Three common date problems
- Dates shown as numbers. You see 45292 instead of a date. The cell has a number format instead of a date format.
- Mixed styles in one column. Data from different people or systems is written differently: 2024-03-15, 15/03/2024, 15.03.2024, 15 Mar 2024. Sorting puts them in the wrong order.
- Dates that can be read two ways. 03/04/2024 means 3 April in most of the world, but March 4 in the US. A computer can't know which one was meant unless other dates in the column make it clear (13/04/2024 can only be day-first).
There are also impossible dates, like 31 April or 30 February. These are usually typing mistakes, or day and month swapped.
Example
| Row | order date | what it is |
|---|---|---|
| 2 | 2024-03-15 | year-month-day |
| 3 | 15/03/2024 | day/month/year |
| 4 | 45366 | a date shown as a number (15 March 2024) |
| 5 | 31/04/2024 | impossible: April has 30 days |
All four rows were probably meant to be 15 March 2024 or close to it, but sorting and filtering this column won't work.
Fix it in Excel
These steps are for Excel on a Windows or Mac computer. The Excel app on phones and tablets doesn't have these menus; on a phone, use Google Sheets or MyDataFixer instead.
Numbers instead of dates
- Select the cells with numbers like 45292.
- Go to Home and open the number format box (it usually says “General” or “Number”).
- Choose Short Date or Long Date. The numbers turn into dates.
Dates saved as text
- Select the date column.
- Go to Data → Text to Columns, click Next twice.
- Choose Date and pick the order the dates are written in: DMY for day/month/year, MDY for month/day/year, YMD for year-month-day.
- Click Finish. The text becomes real dates.
One style for the whole column
Once all values are real dates, select the column, right-click → Format Cells → Date (or Custom, and type a format such as yyyy-mm-dd or dd/mm/yyyy).
Fix it in Google Sheets
- Select the cells.
- Go to Format → Number → Date.
- For another style, choose Format → Number → Custom date and time.
If dates are read the wrong way round, check the spreadsheet's country: File → Settings → Locale. With most settings (for example the UK), 03/04/2024 is read as 3 April.
Fix it with MyDataFixer
Open your Excel or CSV file in the Error Detector. It checks every date column and finds:
- dates that don't match the usual style of their column;
- impossible dates, such as 31 April or 29 February in a year that isn't a leap year;
- dates that could be read two ways, such as 03/04/2024.
The date fix lets you choose one style for the whole column, for example 2024-03-15, 15/03/2024, 03/15/2024, 15.03.2024, 15 Mar 2024 or Mar 15, 2024. When dates could be day-first or month-first, it asks you which one the column uses. MyDataFixer never guesses. Impossible dates and two-digit years such as ’24 are never changed by themselves; they are listed so you can correct them by hand.
You see a preview of every change before anything happens, you can undo, and your file stays on your device. The same fix is in the Spreadsheet Cleaner.
Which date style should you use?
Year-month-day (2024-03-15) is the safest when files are shared or imported. It can't be misread in any country, and it sorts correctly even as text. For reports read by people in one country, use the style they are used to, such as 15/03/2024 in the UK.
How to avoid date problems next time
- Agree on one style. If several people fill in a sheet, write the date style in the column name, for example “order date (yyyy-mm-dd)”.
- Use data validation. In Excel, Data → Data Validation → Date lets only real dates into a column.
- Write the month as a word when sharing with other countries: 3 Apr 2024 can't be misread.
Quick summary
Numbers like 45292 are real dates that only need a date format. Text dates need converting with Text to Columns. Mixed styles should be changed to one style, and unclear dates checked at the source. MyDataFixer finds all of these and asks before it changes anything.
Common mistakes
- Changing only the look. A date format doesn't help text dates. Convert them to real dates first (Text to Columns).
- Guessing the order. If a column has only dates like 03/04/2024, ask the person who made the file which order they use.
- Ignoring impossible dates. 31/04/2024 is a sign that day and month may be swapped in other rows too.
Fix it in your browser
Free, no sign-up. Your file is processed on your device and never uploaded.
Questions and answers
Why does my date show as 45292?
Excel counts days since 1900, so 45292 is 1 January 2024. Change the cell format to a date format to see it as a date.
Which date format is best?
Year-month-day (2024-03-15) can't be misread and sorts correctly, so it's the safest when files are shared between countries.
Why are my day and month swapped?
The file was made with month-first dates (US style) and opened with day-first settings, or the other way round. Convert with Text to Columns and choose the order the file uses.
Can MyDataFixer fix dates in a CSV file?
Yes. It reads the dates in CSV and Excel files, and you choose the style they should all be written in.
Does MyDataFixer upload my file?
No. Your file is checked and fixed in your browser, on your device.