New: 6 free SQL practice datasets with 300+ questions — try the SQL Compiler →
Excel

Excel Data Types and Number Formats Explained

Excel data types and number formats explained: numbers, text, dates, numbers stored as text, custom formats and the TEXT function, with real results.

Upskly AI Team September 27, 2026 13 min read
Excel Data Types and Number Formats Explained

A data type in Excel is the kind of value a cell holds. There are four main ones: numbers (dates and times are numbers too), text, logical values (TRUE and FALSE) and errors such as #N/A. A number format is a different thing: it controls only how a value is displayed, and the value stored in the cell does not change.

Mixing the two up causes a whole family of “my formula gives the wrong answer” problems: totals that skip numbers because they are really text, dates that appear as 45292, and sums that look wrong because the cells were rounded only on screen. This guide shows how to tell the types apart, how formats work, and how to fix each problem. Every result comes from running it in Microsoft Excel.

In this guide

The short version

  • Every cell holds a number, text, TRUE/FALSE or an error. Dates and times are numbers.
  • By default numbers align to the right, text to the left and TRUE/FALSE and errors to the centre. A number that hugs the left edge is probably text.
  • A number format only changes what you see. Use ROUND when you need the value itself changed.
  • Use TEXT(value, "format") to put a formatted number or date inside a text formula.

The four data types and how to tell them apart

The grid below holds one example of each type. Column B shows the result of TYPE(), which returns a code for the type, and columns C and D test the two most common ones. Notice how Excel aligns each value:

ABCD
1Cell contentTYPEISNUMBERISTEXT
21231TRUEFALSE
31232FALSETRUE
4Hello2FALSETRUE
5TRUE4FALSEFALSE
6#N/A16FALSEFALSE
72024-01-151TRUEFALSE
What TYPE() returns
TYPE codeData typeExample in the grid
1Number (dates and times too)123 and the date in row 7
2TextHello, and 123 typed as text
4LogicalTRUE
16Error#N/A

Rows 2 and 3 look almost identical, but row 2 is the number 123 (right-aligned, ISNUMBER is TRUE) and row 3 is the text “123” (left-aligned, ISNUMBER is FALSE). Row 7 shows that a date is an ordinary number, with TYPE 1. That is the root of the next two sections.

Numbers stored as text

A number stored as text looks like a number but is a piece of text. It usually comes from imported data, copied web tables, or a cell that was formatted as Text before the number was typed. Excel often marks such cells with a small green triangle. The cell A2 below holds the text 20 between two real numbers:

Column A holds 10, the text 20, and 30
FormulaExcel showsWhy
=SUM(A1:A3)40SUM ignores text in referenced cells
=A1+A2+A360the + operator converts text that looks like a number
=COUNT(A1:A3)2COUNT counts only real numbers
=COUNTA(A1:A3)3COUNTA counts anything that is not empty
=ISNUMBER(A2)FALSEit is text, not a number
=A2=20FALSEtext never equals a number
=VALUE(A2)20VALUE converts the text to a number
=–A220a double minus converts it too
=A2*120so does any arithmetic that changes nothing
=VALUE(A2)=20TRUE
=SUM(–A1:A3)60convert the whole range first, then sum (Excel 365 or an array formula)

The dangerous case is when all the numbers are text. SUM does not complain, it just returns 0:

A1 to A3 are the text 10, 20 and 30
A
110
220
330
40
560

To fix a column for good, use Data, Text to Columns, Finish on the column, or type 1 in an empty cell, copy it, select the numbers and use Paste Special, Multiply. Both turn the text into real numbers. To fix them inside a formula, use VALUE or the double minus.

Dates and times are numbers

Excel stores a date as the number of days since 1 January 1900, so 1 January 2024 is 45292. It stores a time as a fraction of a day, so noon is 0.5. The cell shows a date only because it has a date format. That is why you can subtract dates and add days:

A1 holds 1 January 2024 with a date format
FormulaExcel showsWhy
=A145292the same cell shown with the General format
=A1+304532230 days later, as a serial number
=TEXT(A1+30,"yyyy-mm-dd")2024-01-31the same date, formatted as text
=A1+0.545292.5half a day is noon
=TEXT(A1+0.5,"yyyy-mm-dd hh:mm")2024-01-01 12:00
=DATE(2024,3,1)-A160days between the two dates
=TEXT(A1,"dddd")Mondaythe day name
=TIME(18,0,0)0.7518:00 is three quarters of a day
=TEXT(0.75,"h:mm AM/PM")6:00 PM

If a date suddenly shows as 45292, its format was changed to General or Number. Set the cell back to a date format (Ctrl + 1, then Date) and the value is unchanged.

Number formats change the display, not the value

A number format is a display rule attached to a cell. It never touches the stored value. That is normally what you want, but it produces one very confusing situation. Here three cells hold 1.4 and are formatted with no decimals, and the total is the sum of the real values:

Three cells holding 1.4, shown with no decimals, and their total
A
11
21
31
44

The screen says 1 + 1 + 1 = 4, and both are “right”: the cells show 1, but they really hold 1.4, so the total is 4.2, which displays as 4. Multiply the total by 10 and you get 42, not 40. If you want the total to match what is shown, round the values themselves:

=SUM(ROUND(A1:A3,0)) rounds each value before adding
A
11
21
31
43

The rule of thumb: use a format when you only want to show fewer decimals, and use ROUND when the value itself must change, for example before a total that people will check by hand.

Custom number formats

Press Ctrl + 1, choose Custom and type a format code. A code can have up to four sections separated by semicolons: positive; negative; zero; text. Here are common ones, each applied to the typed value shown:

Custom number formats, run in Excel
Typed valueFormat codeExcel showsWhat it does
1234.50.001234.50always two decimals
1234.5#,##0.01,234.5thousands separator and one decimal
0.2560%26%percentage, no decimals (0.256 becomes 26%)
0.2560.0%25.6%percentage with one decimal
7000007pads with leading zeros to three digits
420" kg"42 kgadds a unit as text; the value is still a number
-50;(0)(5)negative numbers in brackets
00;-0;"zero"zeroa word for zero, with the three-section pattern
45292dd-mmm-yyyy01-Jan-2024date as day, short month, year
45292ddddMondaythe weekday name of the date
45292mmm yyJan 24short month and two-digit year
0.75h:mm AM/PM6:00 PM12-hour time from a fraction of a day
15000.0,"K"1.5Ka comma at the end divides by 1000
12345670.00E+001.23E+06scientific notation
5;;;(nothing)hides the value completely

In every row the cell still holds the number you typed. The format only decides how it looks, and formulas that refer to the cell use the real value.

Leading zeros and long numbers

Excel treats anything that looks like a number as a number. That is helpful for prices and unhelpful for IDs: it removes leading zeros and it keeps only 15 significant digits. Anything after the 15th digit becomes zero:

A1 is 007 typed normally, A2 is 007 typed as text, A3 is 1234567890123456
FormulaExcel showsWhy
=A17the leading zeros are gone
=A2007typed as text, so 007 stays
=A31.23457E+15shown in scientific notation
=TEXT(A3,"0")1234567890123450the last digit was replaced by 0
=A3=1234567890123457TRUEtwo different 16-digit numbers compare as equal
=ISNUMBER(A1)TRUE
=ISNUMBER(A2)FALSE

For codes, phone numbers, account numbers and anything else you will not calculate with, store the value as text: format the cells as Text before typing, or start the entry with an apostrophe ('007). If the value must stay a number, keep it a number and use a custom format such as 00000 to show the zeros:

A1 holds the number 123 with the format 00000

AB
100123124

A1 is still the number 123, so A1+1 works

AB
100123=A1+1

The TEXT function

A cell’s format disappears the moment you join it into a text formula, because the join uses the raw value. TEXT(value, format_code) converts a value to text with the format you choose, using the same codes as the custom formats above:

A1 is 15 March 2024, A2 is 0.256, A3 is 1234.5 and A4 is 7
FormulaExcel showsWhy
="Due "&A1Due 45366the date turns into its serial number
="Due "&TEXT(A1,"dd-mmm-yyyy")Due 15-Mar-2024TEXT keeps the date readable
=TEXT(A2,"0.0%")25.6%
=TEXT(A3,"#,##0.00")1,234.50
=TEXT(A4,"000")007
=ISTEXT(TEXT(A4,"000"))TRUETEXT always returns text
=TEXT(A4,"000")+18text that looks like a number is converted again by +

Remember that the result of TEXT is text. It lines up to the left, and functions like SUM will ignore it. Use it for labels and messages, not for numbers you still need to add.

Empty cells, zero and empty text

An empty cell, a cell holding 0 and a cell holding empty text (="") are three different things that often look the same. A1 below is empty, A2 holds the formula ="" and A3 holds 0:

Testing an empty cell (A1), empty text (A2) and zero (A3)
FormulaExcel showsWhy
=ISBLANK(A1)TRUEtruly empty
=ISBLANK(A2)FALSEnot empty: it holds a formula
=A1=""TRUEan empty cell equals empty text
=A2=""TRUE
=A1=0TRUEan empty cell also equals 0
=A2=0FALSEempty text is not zero
=COUNT(A1:A3)1only the 0 is a number
=COUNTA(A1:A3)2counts the formula cell and the zero
=COUNTBLANK(A1:A3)2counts both the empty cell and the empty text

The practical lesson: test emptiness with =A1="" if formulas may return empty text, and use ISBLANK only when you need to know the cell is really empty.

Common mistakes

Mistake 1: trusting the display

What you see is a formatted view of the value. If two numbers look equal but a comparison says they are not, or a total looks off by one, check the real value with General format or the formula bar, and use ROUND when needed.

Mistake 2: a column that is too narrow

A number or date that does not fit the column width is shown as hash signs. It is not an error and the value is fine. Widen the column:

A1 holds 123456789 (format 0) and B1 a date, both in columns that are too narrow
AB
1##########

Mistake 3: formatting a cell as Text and then typing a formula

Cells formatted as Text keep whatever you type as text, including formulas. A1 below was formatted as Text first, B1 was not. Both were given the entry =1+1:

The same entry in a Text-formatted cell (A1) and a General cell (B1)
AB
1=1+12

If a formula shows up as text, change the format back to General and re-enter it (press F2, then Enter).

Mistake 4: joining a date or a percentage without TEXT

As shown above, ="Due "&A1 prints the serial number. Always wrap dates, percentages and decimals in TEXT when you build sentences.

Cheat sheet

Data types and formats cheat sheet
TaskHowNote
Tell number from textISNUMBER(A1), ISTEXT(A1), TYPE(A1)left alignment is a clue
Convert text to a numberVALUE(A1), –A1 or Data, Text to ColumnsPaste Special, Multiply also works
Show a number differentlyCtrl + 1, Number tabthe value does not change
Really round a valueROUND(A1, 2)the format alone does not round
Keep leading zerosformat as Text first, or use the format 00000text for IDs, format for numbers
Keep 16 or more digitsstore as textExcel keeps 15 significant digits
Format inside a formulaTEXT(A1, "dd-mmm-yyyy")the result is text
Show a date as a numberset the format to Generalor use A1 + 0
Is the cell really empty?ISBLANK(A1)A1 = "" also catches empty text

Try it yourself

Work out each answer first, then open the solution. Type the examples into a worksheet to check.

1. A1:A3 hold the text 10, 20 and 30, and =SUM(A1:A3) shows 0. Give two formulas that return the real total.

Show solution
A1:A3 hold the text 10, 20 and 30
FormulaExcel shows
=SUM(A1:A3)0
=SUM(–A1:A3)60
=SUMPRODUCT(–A1:A3)60
=SUMPRODUCT(A1:A3*1)60

=SUM(--A1:A3) and =SUMPRODUCT(--A1:A3) convert the text before adding. To fix the cells themselves, use Text to Columns.

2. A1 holds 0.075 and is formatted as 0%. What does the cell show, and what does =A1*100 return?

Show solution

The cell shows 8%, because the format rounds for display only. =A1*100 returns 7.5, because the stored value is still 0.075.

3. You need to display the number 123 as 00123 but still be able to add 1 to it. How?

Show solution

Number 123 with the format 00000

AB
100123124

Still a number

AB
100123=A1+1

Keep it a number and apply the custom format 00000. Typing the text 00123 would keep the zeros too, but it would no longer be a number.

4. A1 holds a date. Write a formula that returns a sentence such as Invoice date: 15 Mar 2024.

Show solution
A1 holds 15 March 2024
FormulaExcel shows
="Invoice date: "&TEXT(A1,"dd mmm yyyy")Invoice date: 15 Mar 2024

Without TEXT, the sentence would end with the serial number 45366.

Frequently asked questions

What are the data types in Excel?

Numbers (including dates and times), text, logical values (TRUE and FALSE) and errors such as #N/A. Every cell holds exactly one of them, or is empty.

Why does Excel show my date as a number like 45292?

Excel stores dates as serial numbers, and the cell has lost its date format (it is set to General or Number). Apply a Date format with Ctrl + 1 and the date returns; the value does not change.

How do I convert text to numbers in Excel?

Use VALUE(A1) or --A1 in a formula, or fix the cells themselves with Data, Text to Columns, Finish, or with Paste Special, Multiply by 1.

Does formatting a cell change its value?

No. A number format changes only how the value is displayed. Use ROUND when you need the stored value to change.

How do I keep leading zeros in Excel?

Format the cells as Text before typing, or start the entry with an apostrophe. If the value must remain a number, use a custom format such as 00000.

Why do long numbers end in zeros?

Excel keeps only 15 significant digits of a number. For 16-digit values such as card or account numbers, store them as text.

What does the TEXT function do?

TEXT(value, format_code) turns a number or date into text formatted the way you specify, so it can be joined into a sentence. Its result is text, not a number.

What is the difference between an empty cell and a cell with zero?

An empty cell holds nothing, a zero cell holds the number 0, and a formula such as ="" holds empty text. They behave differently in COUNT, COUNTA, ISBLANK and comparisons.

Test yourself

Timed questions on Data Types and Number Formats, with an explanation for every answer.

Take the Quiz
Upskly AI Team
Learning made simple
Scroll to Top