Do not convert to date excel

Excel for Microsoft 365 Excel for the web Excel 2021 Excel 2019 Excel 2016 Excel 2013 Excel 2010 More…Less

Microsoft Excel is preprogrammed to make it easier to enter dates. For example, 12/2 changes to 2-Dec. This is very frustrating when you enter something that you don’t want changed to a date. Unfortunately there is no way to turn this off. But there are ways to get around it.

Preformat the cells you want to enter numbers into as Text. This way Excel will not try to change what you enter into dates.

If you only have a few numbers to enter, you can stop Excel from changing them into dates by entering:

  • A space before you enter a number. The space remains in the cell after you press Enter. (See Notes)

  • An apostrophe (‘) before you enter a number, such as ’11-53 or ‘1/47. The apostrophe isn’t displayed in the cell after you press Enter.

  • A zero and a space before you enter a fraction such as 1/2 or 3/4 so that they don’t change to 2-Jan or 4-Mar, for example. Type 0 1/2 or 0 3/4. The zero doesn’t remain in the cell after you press Enter, and the cell becomes the Fraction number type.

  1. Select the cells that you’ll enter numbers into.

  2. Press Ctrl + 1 (the 1 in the row of numbers above the QWERTY keys) to open Format Cells.

  3. Select Text, and then click OK.

  1. Select the cells you want to enter numbers into.

  2. Click Home > Number Format > Text.

Notes: 

  • We recommend using an apostrophe instead of a space for entering data if you plan on using lookup functions against the data. Functions like MATCH or VLOOKUP overlook the apostrophe when calculating the results.

  • If a number is left-aligned in a cell that usually means it isn’t formatted as a number.

  • If you type a number with an “e” in it, such as 1e9, it will automatically result in a scientific number: 1.00E+09. If you don’t want a scientific number, enter an apostrophe before the number: ‘1e9

  • Depending on the number entered, you may see a small green triangle in the upper left corner of the cell, indicating that a number is stored as text, which to Excel is an error. Either ignore the triangle, or click on it. A box will appear to the left. Click the box, and then select Ignore Error, which will make the triangle go away.

Need more help?

You can always ask an expert in the Excel Tech Community or get support in the Answers community.

Need more help?

Excel has some really smart features that can be really useful in many cases (and sometimes it could be frustrating).

One such area is when you enter numbers in Excel. Sometimes, Excel automatically changes these numbers to dates.

For example, if you enter 1/2 in Excel, Excel will automatically change this to 01-02-2020 (or 02-01-2020 if you’re in the US)

Similarly, if you enter 30-06-2020, Excel assumes you want to enter a date, and it changes this to a date (as shown below)

Number Changes to date when entered in Excel

While this may be what you want in most cases, but what if I don’t want this. What if I simply want the exact text 30-06-2020 or the fraction 1/2.

How do I stop Excel from changing numbers to dates?

That’s what this tutorial is about.

In this Excel tutorial, I will show you two really simple ways to stop Excel from changing numbers to text.

But before I show you methods, let me quickly explain why Excel does this.

Why does Excel Changes Numbers to Date?

While it can be frustrating when Excel does this, it’s trying to help.

In most cases, when people enter numbers that can also represent valid date formats in Excel, it will automatically convert these numbers into dates.

And this just doesn’t mean that it changes the format, it actually changes the underlying value.

For example, if you enter 3/6/2020 (or 6/3/2020 if you’re in the US and using the US date format), Excel changes the cell value to 44012, which is the numerical value of the date.

Also read: How to Convert Numbers to Text in Excel

Stop Excel from Changing Numbers to Dates Automatically

The only way to stop Excel from changing these numbers (or text string) into dates is by clearing letting it know that these are not numbers.

Let’s see how to do this.

Change the format to text

The easiest way to make sure Excel understands that it’s not supposed to change a number to date is by specifying the format of the cell as Text.

Since dates are stored as numbers, when you make the format of a cell text, Excel will understand that the entered number is supposed to be in the text format and not to be converted into a date.

Below is how you can stop Excel from changing numbers to dates:

  1. Select the cell or range of cells where you want to make the format as Text
  2. Click the Home tabClick the Home tab
  3. In the Number group, click on the dialog box launcher icon (or you can use the keyboard shortcut Control + 1).Click on the dialog launcher icon
  4. In the Format Cells dialog box, in the category option, click in Text
  5. Click OK

The above steps would change the cell format to text. Now when you enter any number such as 30-06-2020 or 1/2, Excel will not convert these into date format.

You can also open the Format Cells dialog box by selecting the cell, right-clicking on it and then clicking on the Format Cell option.

Note: You need to change the format before you enter the number. If you do this after the number has been entered, this would change the format to text but you would get the numeric value of the date and not the exact number/text-string you entered.

This method is best suited when you have to change the format of a range of cells. If you only have to do this for a couple of cells, it’s best to use the apostrophe method covered next

Also read: How to Convert Serial Numbers to Dates in Excel (2 Easy Ways)

Add an Apostrophe before the Number

If you only have to enter a number in a few cells and you don’t want Excel to change it to date, you can use this simple technique.

Just add an apostrophe sign before you enter the number (as shown below).

Stop Excel from Changing Numbers to Dates Using apostrophe

When you add an apostrophe at the very beginning, Excel considers that cell as text.

While you would not see the apostrophe sign, you can visually see that the numbers would be aligned to the left (indicating that it’s text).

By default, all numbers align to the right and all text values align to the left.

Another benefit of using the apostrophe sign is that you can still use the lookup formulas (such as VLOOKUP or MATCH) using the value in the cell. The apostrophe will be ignored by these functions.

You can also use this method to change existing dates into text. For example, if you have 30-06-2020 in a cell, you can simply add an apostrophe (‘) at the beginning and it will be changed the date to text

Sometimes, you may see a green triangle at the top-left part of the cell, which indicates that numbers have been stored as text in those cells. But since that’s exactly what we want in this case, you can ignore those green triangles, or click on it and then select the Ignore Error option to make it go away.

While these methods are great, what if you have a column full of dates that you want to use as a text and not as dates. Here are some simple methods you can use to convert date to text in Excel.

I hope you found this Excel tutorial useful!

You may also like the following Excel tutorials:

  • How to Remove Cell Formatting in Excel
  • How to Remove Time from Date/Timestamp in Excel
  • How to Wrap Text in Excel
  • Convert Time to Decimal Number in Excel (Hours, Minutes, Seconds)
  • How to Stop Excel from Rounding Numbers
  • How to Display Numbers as Fractions in Excel (Write Fractions in Excel)
  • How to Compare Dates in Excel (Greater/Less Than, Mismatches)

Excel by default tends to make it easier to enter dates. It is preprogrammed to handle numbers as Dates and convert them accordingly. Number in formats, separated by a backslash (/) or by a hyphen (-), are automatically converted to dates by Excel. For example, 13/6 or 13-6 gets converted to 13-Jun automatically by Excel.

Number automatically changed to date in Excel

But we don’t always need the default conversion to take place. At times users need to store general numbers separated by a ‘/’ and do not want to convert to the preprogrammed DATE format.

Recommended Read: How to Change Date Format in Excel

Since there is no direct way or option to switch this off in Excel, let’s look at the steps to make this happen.

Steps to avoid conversion of numbers to dates

But we can perform a bit of tweaking to avoid this automatic conversion of numbers to dates in Excel, and that is by using formatting options. Follow the below step-by-step guide to performing that easily.

1. Format Option (most relevant)

All the above-discussed methods to avoid conversion can only be performed if Data is either to be entered manually (no copy-paste) or when the data set to be inputted is small.

This method enables us to stop the conversion of not only a single cell but columns and rows at a time, by selecting all as per requirement.

Select the cell or cells in which you want to perform, and then open the ‘Format Cells‘ option menu by:

  • Press Ctrl + 1 or Go to the ‘Home’ tab
  • Then go to ‘Format’ drop-down menu
  • Now select ‘Text‘ in the pop-up option menu
  • Click ‘OK‘ to apply
Choose Text formatting option in Excel
Choose Text formatting option

The final result of this formatting after clicking OK would be –

Final Result of formatting in Excel to change number from Date to text
Final Result of formatting

2. Use a space

Add a space before inputting the number in the cell in any desired format, to stop excel from the automatic conversion of your input number to Excel.

Then press Enter. Even after pressing Enter, the inputted space remains there in the cell.

adding space before the number in Excel
adding space before the number

3. Use an apostrophe(‘)

To avoid conversion, you may even use apostrophes.

Input an apostrophe (‘) sign before the inputted number and press Enter. This apostrophe would not be visible in the actual data set.

For example: ’23/2 results in 23/2 only. Without the apostrophe and even without conversion.

adding apostrophe before the number in excel
adding apostrophe

4. Use 0 + ‘ ‘

Input ‘0’ followed by a space, before the inputted number, to avoid automatic conversion of the number.

For example, 0 3/2 results finally to 3/2.

adding zero and space before number
adding zero and space before a number

Note: This method converts the cell input to fraction type.

Conclusion

That’s it. We’ve learned how to stop Excel from changing Numbers to Dates automatically and get our inputted value in the desired format.

We hope you learned and enjoyed this lesson and we’ll be back soon with another awesome Excel tutorial at QuickExcel!

Sometimes importing data into spreadsheets can be a headache. While this issue is not directly related to Datawrapper, it’s a common problem with Excel that can be frustrating and time-consuming: Excel is trained to «detect» formats, and sometimes the software wrongly assumes that a certain number represents a date. If you enter 12/2, it will change to 2-Dec or 12. Feb. If you then ask Excel to change the format to «Text,» it shows you a weird high number like 44239. 

So, how can you show a column with values like 12/2 without having them converted into dates?

How to get around this in Excel

The trick is to choose the format of the column before you enter or paste the data:

  • Open Excel 
  • Select the columns or cells you want to paste into and choose «Text» in the format dropdown of the Home tab. You can also press Cmd+1 to select «Text» there and then click «Ok.» 
  • Now make sure that your data is pasted as text. To do so, go to the Home tab, then click on the little arrow next to «Paste» and select «Match Destination Formatting.» (To achieve the same result, you can also go to Edit > Paste Special…, and then select «Text» before clicking «Ok.»)
  • You’ll see little green triangles in the top left of your pasted cells. Select them, click on the warning sign ⚠️ and select «Ignore Error.»

Here’s a 30 second video showing the whole process: 

Please note that you can’t perform calculations such as SUM with the pasted text. 

Choosing the correct format in Datawrapper

Even if Excel now thinks that your numbers are text, our data visualization tool Datawrapper will be able to recognize them. As soon as you upload the numbers to Datawrapper, it guesses what data format your columns have. 

If that guess is wrong, you can easily change the format again. Click on the column, then choose the correct format in the drop-down menu that pops up on the left side:

Special formatting tricks to avoid having Excel change numbers into dates

Excel documentation has some additional tips on how to avoid that automatic change of numbers:

  • Manual inspection
    If your dataset has only a few lines, you can manually check whether datapoints where wrongly changed into dates. They are quite easy to spot in the columns.
  • To then change the format back: 
    • Add a space before the number. Press Enter to make sure that this space remains in the cell.
    • Or, add an apostrophe (‘) BEFORE you enter the number, e.g. ‘1/2. The apostrophe will not be displayed after pressing Enter.
    • Or, add a zero and space before number formats such as 1/2 to avoid the change to date format.
    • Or, change fractions into decimals, e.g. 1/2 to 0.5 (or 0,5, if that is your local decimal format).

Last updated on July 13, 2022

I know this is an old question, but the problem is not going away soon. CSV files are easy to generate from most programming languages, rather small, human-readable in a crunch with a plain text editor, and ubiquitous.

The problem is not only with dates in text fields, but anything numeric also gets converted from text to numbers. A couple of examples where this is problematic:

  • ZIP/postal codes
  • telephone numbers
  • government ID numbers

which sometimes can start with one or more zeroes (0), which get thrown away when converted to numeric. Or the value contains characters that can be confused with mathematical operators (as in dates: /, -).

Two cases that I can think of that the «prepending =» solution, as mentioned previously, might not be ideal is

  • where the file might be imported into a program other than MS Excel (MS Word’s Mail Merge function comes to mind),
  • where human-readability might be important.

My hack to work around this

If one pre/appends a non-numeric and/or non-date character in the value, the value will be recognized as text and not converted. A non-printing character would be good as it will not alter the displayed value. However, the plain old space character (s, ASCII 32) doesn’t work for this as it gets chopped off by Excel and then the value still gets converted. But there are various other printing and non-printing space characters that will work well. The easiest however is to append (add after) the simple tab character (t, ASCII 9).

Benefits of this approach:

  • Available from keyboard or with an easy-to-remember ASCII code (9),
  • It doesn’t bother the importation,
  • Normally does not bother Mail Merge results (depending on the template layout — but normally it just adds a wide space at the end of a line). (If this is however a problem, look at other characters e.g. the zero-width space (ZWSP, Unicode U+200B)
  • is not a big hindrance when viewing the CSV in Notepad (etc),
  • and could be removed by find/replace in Excel (or Notepad etc).
  • You don’t need to import the CSV, but can simply double-click to open the CSV in Excel.

If there’s a reason you don’t want to use the tab, look in an Unicode table for something else suitable.

Another option

might be to generate XML files, for which a certain format also is accepted for import by newer MS Excel versions, and which allows a lot more options similar to .XLS format, but I don’t have experience with this.

So there are various options. Depending on your requirements/application, one might be better than another.


Addition

It needs to be said that newer versions (2013+) of MS Excel don’t open the CSV in spreadsheet format any more — one more speedbump in one’s workflow making Excel less useful… At least, instructions exist for getting around it. See e.g. this Stackoverflow: How to correctly display .csv files within Excel 2013?
.

Понравилась статья? Поделить с друзьями:
  • Do not check spelling and grammar in word
  • Do not change the word given use from three to five words
  • Do not change the word given in brackets
  • Do not breathe a word of перевод
  • Do not break word html