# How to use the TYPE function

**What is the TYPE function?**

The TYPE function returns a number representing what type of data is returned by a function or formula.

**What is a formula?**

A formula in Excel is an expression that calculates a value based on the values in other cells. Formulas must start with an equals sign "=" and can contain cell references, math operators, functions, constants, arrays, etc. They are used to perform calculations in Excel.

**Related TYPE functions**

Excel Function | Description |
---|---|

TYPE(value) | Returns a number indicating the data type of value |

INFO(type_text) | Returns information about the current operating environment |

ERROR.TYPE(error_val) | Returns a number corresponding to the type of error in error_val |

CELL(info_type, reference) | Returns information about the formatting, location, or contents of a cell |

### TYPE function Syntax

TYPE(*value*)

### TYPE function Arguments

value |
Required. Any value. |

If value is | Type function returns |
---|---|

Number |
1 |

Text |
2 |

Logical value |
4 |

Error value |
16 |

Array |
64 |

**What is a number?**

A number in Excel refers to numeric data entered without quotation marks and are aligned to the right. Numbers can be integers, decimals, percentages, formatted numbers, results of formulas.

**What is text in Excel?**

Excel tries to identify inserted values automatically, text values are left-aligned. Boolean values and error values are centered in cells, and numerical values are right-aligned. You can change the alignment if you like.

Cells containing text values evaluates to TRUE by the ISTEXT function. The ISNTEXT function lets you check a value programmatically in a formula instead of visually identify values by their position in a cell.

**What is an error value?**

An error value is returned when something is wrong, it may be a formula that contains an error, a function with missing parameters or a misspelled function etc.

Here are a few common errors in Excel:

**#NULL error**- This error occurs most often if you by mistake use a space character in a formula where it shouldn't be. Excel interprets a space character as an intersection operator. If the ranges don't intersect an #NULL error is returned. The #NULL! error occurs when a formula attempts to calculate the intersection of two ranges that do not actually intersect. This can happen when the wrong range operator is used in the formula, or when the intersection operator (represented by a space character) is used between two ranges that do not overlap. To fix this error double check that the ranges referenced in the formula that use the intersection operator actually have cells in common.**#SPILL error**- The #SPILL! error occurs only in version Excel 365 and is caused by a dynamic array being to large, meaning there are cells below and/or to the right that are not empty. This prevents the dynamic array formula expanding into new empty cells.**#DIV/0 error**- This error happens if you try to divide a number by 0 (zero) or a value that equates to zero which is not possible mathematically. Use the "Evaluate formula" tool to pinpoint the exact location in the formula where this error occurs. The "Evaluate formula" tool is located on the "Formulas" tab on the ribbon. Select the cell containing the #DIV/0 error and then press with left mouse button on the "Evaluate formula button".**#VALUE error**- The #VALUE error occurs when a formula has a value that is of the wrong data type. Such as text where a number is expected or when dates are evaluated as text.**#REF error**- The #REF error happens when a cell reference is invalid. This can happen if a cell is deleted that is referenced by a formula.**#NAME error**- The #NAME error happens if you misspelled a function or a named range.**#NUM error**- The #NUM error shows up when you try to use invalid numeric values in formulas, like square root of a negative number.**#N/A error**- The #N/A error happens when a value is not available for a formula or found in a given cell range, for example in the VLOOKUP or MATCH functions.**#GETTING_DATA error**- The #GETTING_DATA error shows while external sources are loading, this can indicate a delay in fetching the data or that the external source is unavailable right now.

**What is an array in Excel?**

Some functions return an array of values instead of a single value. Excel 365 handles these arrays automatically whereas previous versions need to be entered as an array formula.Â For example, the FREQUENCY function returns multiple values.

You can also create a formula that returns multiple values, in Excel 365 they are named dynamic array formulas and in earlier versions named array formulas. The most simple dynamic array formula I know is this: = A1:A2, it returns two values populated in cells A1 and A2.

### TYPE function example

Formula in cell C3:

You can'tÂ use the TYPE function to determine the type of value in a specific cell using a cell reference, the TYPE function will then return the type of the formula's returning value.

Even if the formula returns an array the TYPE function returns only the type of the value displayed in that cell.

### TYPE function array

Example, the picture above demonstratesÂ an array entered in cell range B3:B4:

The TYPE function returns 1 and 2 and not 64.

### Functions in 'Information' category

The TYPE function function is one of 19 functions in the 'Information' category.

## How to comment

How to add a formula to your comment<code>Insert your formula here.</code>

Convert less than and larger than signsUse html character entities instead of less than and larger than signs.

< becomes < and > becomes >

How to add VBA code to your comment[vb 1="vbnet" language=","]

Put your VBA code here.

[/vb]

How to add a picture to your comment:Upload picture to postimage.org or imgur

Paste image link to your comment.

Contact OscarYou can contact me through this contact form