User Avatar
Discussion

How to show data types in Excel?

How to Show Data Types in Excel: A Comprehensive Guide

Microsoft Excel is a powerful tool for managing and analyzing data. One of its key features is the ability to handle various data types, such as text, numbers, dates, and more. Understanding and displaying data types in Excel is essential for ensuring data accuracy, performing calculations, and creating meaningful visualizations. In this guide, we’ll explore how to show data types in Excel, including built-in features, formulas, and advanced techniques.


1. Understanding Data Types in Excel

Before diving into how to show data types, it’s important to understand what data types Excel supports. Here are the most common ones:

  • Text: Alphanumeric characters, such as names, addresses, or descriptions.
  • Numbers: Numeric values, including integers, decimals, and percentages.
  • Dates and Times: Date and time values, which Excel stores as serial numbers.
  • Boolean: Logical values, such as TRUE or FALSE.
  • Errors: Special values like #N/A, #VALUE!, or #DIV/0! that indicate errors in formulas.
  • Formulas: Expressions that perform calculations or manipulate data.

Excel automatically assigns a data type to each cell based on the input. However, sometimes you may need to explicitly check or display the data type for better data management.


2. Using Built-In Features to Show Data Types

Excel provides several built-in tools to help you identify and display data types.

2.1. Data Type Gallery (Excel 365 and Excel 2021)

If you’re using Excel 365 or Excel 2021, you can use the Data Type Gallery to assign and display data types for specific cells. This feature is particularly useful for working with structured data like stocks, geography, or currencies.

  1. Select the cells containing your data.
  2. Go to the Data tab in the ribbon.
  3. Click on the Data Types dropdown in the "Data Tools" group.
  4. Choose a data type (e.g., Stocks, Geography).
  5. Excel will automatically detect and display the data type for the selected cells.

For example, if you enter a list of company names and assign the "Stocks" data type, Excel will pull in real-time stock information like price, market cap, and more.

2.2. Format Cells

You can also use the Format Cells dialog box to check or change the data type of a cell.

  1. Select the cell or range of cells.
  2. Right-click and choose Format Cells from the context menu.
  3. In the Number tab, you’ll see the current data type (e.g., General, Number, Date, Text).
  4. You can change the data type by selecting a different category and clicking OK.

This method is useful for ensuring that your data is formatted correctly, especially when importing data from external sources.


3. Using Formulas to Identify Data Types

Excel doesn’t have a built-in function to directly display the data type of a cell. However, you can use a combination of formulas to infer the data type.

3.1. Using the TYPE Function

The TYPE function returns a numeric code representing the data type of a value. Here’s how it works:

  • 1: Number
  • 2: Text
  • 4: Logical (TRUE or FALSE)
  • 16: Error
  • 64: Array

For example:

  • =TYPE(123) returns 1 (Number).
  • =TYPE("Hello") returns 2 (Text).
  • =TYPE(TRUE) returns 4 (Logical).

This function is useful for checking the data type of a single value.

3.2. Using the IS Functions

Excel provides a set of IS functions to test for specific data types:

  • ISNUMBER: Returns TRUE if the value is a number.
  • ISTEXT: Returns TRUE if the value is text.
  • ISLOGICAL: Returns TRUE if the value is a logical (TRUE or FALSE).
  • ISERROR: Returns TRUE if the value is an error.
  • ISBLANK: Returns TRUE if the cell is empty.

For example:

  • =ISNUMBER(A1) returns TRUE if cell A1 contains a number.
  • =ISTEXT(A1) returns TRUE if cell A1 contains text.

These functions are handy for creating conditional formulas or validating data.

3.3. Combining Formulas

You can combine multiple formulas to create a custom data type identifier. For example:

=IF(ISNUMBER(A1), "Number",
 IF(ISTEXT(A1), "Text",
 IF(ISLOGICAL(A1), "Logical",
 IF(ISERROR(A1), "Error", "Unknown"))))

This formula checks the data type of cell A1 and returns a descriptive label.


4. Using Conditional Formatting to Highlight Data Types

Conditional formatting is a powerful tool for visually identifying data types in your worksheet.

  1. Select the range of cells you want to format.
  2. Go to the Home tab and click on Conditional Formatting.
  3. Choose New Rule.
  4. Select Use a formula to determine which cells to format.
  5. Enter a formula to identify the data type. For example:
    • To highlight numbers: =ISNUMBER(A1)
    • To highlight text: =ISTEXT(A1)
  6. Set the formatting options (e.g., fill color, font color) and click OK.

This method allows you to quickly spot cells with specific data types, making it easier to clean and analyze your data.


5. Using Power Query to Show Data Types

Power Query is an advanced tool in Excel for data transformation and analysis. It also provides robust options for identifying and managing data types.

  1. Load your data into Power Query:
    • Select your data range and go to the Data tab.
    • Click on Get & Transform Data > From Table/Range.
  2. In Power Query, each column displays its data type in the header (e.g., ABC for text, 123 for numbers).
  3. You can change the data type by clicking the data type icon in the column header.
  4. Once you’ve adjusted the data types, click Close & Load to load the data back into Excel.

Power Query is particularly useful for handling large datasets and ensuring consistent data types across multiple columns.


6. Using VBA to Display Data Types

For advanced users, Visual Basic for Applications (VBA) can be used to create custom functions or macros to display data types.

Here’s an example of a VBA function that returns the data type of a cell:

Function GetDataType(cell As Range) As String
    Select Case True
        Case IsNumeric(cell.Value): GetDataType = "Number"
        Case IsDate(cell.Value): GetDataType = "Date"
        Case cell.Value = True Or cell.Value = False: GetDataType = "Logical"
        Case IsEmpty(cell): GetDataType = "Blank"
        Case IsError(cell.Value): GetDataType = "Error"
        Case Else: GetDataType = "Text"
    End Select
End Function

To use this function:

  1. Press Alt + F11 to open the VBA editor.
  2. Insert a new module and paste the code above.
  3. Close the editor and return to Excel.
  4. Use the function in a cell, e.g., =GetDataType(A1).

This custom function provides a more detailed description of the data type compared to the TYPE function.


7. Best Practices for Managing Data Types

  • Consistency: Ensure that all cells in a column have the same data type to avoid errors in calculations or analysis.
  • Validation: Use data validation rules to restrict input to specific data types.
  • Cleaning: Regularly clean your data to fix inconsistencies, such as numbers stored as text.
  • Documentation: Document the data types used in your workbook for future reference.

8. Conclusion

Showing data types in Excel is a fundamental skill for effective data management. Whether you use built-in features, formulas, conditional formatting, Power Query, or VBA, understanding how to identify and display data types will help you work more efficiently and avoid common pitfalls. By following the techniques outlined in this guide, you’ll be well-equipped to handle any data type-related challenges in Excel.

Happy Excel-ing!

2.6K views 22 comments

Comments (45)

User Avatar
User Avatar
Kahveci Armando 2025-04-28 10:17:55

This guide is incredibly helpful for anyone working with Excel. The step-by-step instructions make it easy to understand how to display data types clearly.

User Avatar
Fleury Alexis 2025-04-28 10:17:55

I've been using Excel for years, but I never knew about this feature. Thanks for sharing such useful information!

User Avatar
Mendoza Gordan 2025-04-28 10:17:55

The explanations are clear, but it would be great if there were more visual examples to accompany the text.

User Avatar
Lukaveckiy Eugenia 2025-04-28 10:17:55

A very practical tutorial. It saved me a lot of time trying to figure this out on my own.

User Avatar
Moolya Indie 2025-04-28 10:17:55

The article is well-written, but it could benefit from a section on common troubleshooting tips.

User Avatar
Meyer Milian 2025-04-28 10:17:55

I appreciate the simplicity of the instructions. Even beginners can follow along without any issues.

User Avatar
Kristensen Méline 2025-04-28 10:17:55

This is exactly what I needed for my project. The examples provided are spot-on.

User Avatar
Vrhovac Brett 2025-04-28 10:17:55

The content is useful, but the website layout could be improved for better readability.

User Avatar
Chow Katharina 2025-04-28 10:17:55

Great job! I learned something new today thanks to this post.

User Avatar
Erbay Esma 2025-04-28 10:17:55

The guide is thorough, but it would be helpful to include shortcuts for quicker data type display.

User Avatar
de 2025-04-28 10:17:55

I found this article while searching for a solution, and it delivered exactly what I needed.

User Avatar
Pech Romain 2025-04-28 10:17:55

The instructions are straightforward, but a video tutorial would be a great addition.

User Avatar
Simmons Hartwig 2025-04-28 10:17:55

This is a must-read for anyone dealing with data in Excel. Very informative!

User Avatar
da 2025-04-28 10:17:55

The article covers the basics well, but advanced users might need more in-depth details.

User Avatar
Lee Zep 2025-04-28 10:17:55

I love how concise and to-the-point this guide is. No unnecessary fluff.

User Avatar
Timm Wayne 2025-04-28 10:17:55

The tips provided here are practical and can be applied immediately. Highly recommended!

User Avatar
Gupta Nina 2025-04-28 10:17:55

It's a good starting point, but I wish there were more examples for complex data types.

User Avatar
Galindo Ashley 2025-04-28 10:17:55

The author did a great job breaking down the steps. Makes Excel less intimidating.

User Avatar
David Francisca 2025-04-28 10:17:55

Very useful for my work. I'll definitely be sharing this with my colleagues.

User Avatar
کریمی Ellen 2025-04-28 10:17:55

The guide is helpful, but some sections could use more detailed explanations.

User Avatar
Laurila Radmila 2025-04-28 10:17:55

I was able to solve my problem in minutes thanks to this article. Great resource!

User Avatar
Williams Chiara 2025-04-28 10:17:55

Simple and effective. Exactly what I was looking for to improve my Excel skills.