Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Collapse]Spreadsheet
   [Expand]Product Information
    Product Structure
    Getting Started
   [Expand]Spreadsheet Document
    Supported Formats
   [Collapse]Cell Basics
     Cell Data Types
     Dates and Times in Cells
     Error Types
     Cell Referencing
     Formatting Cells
   [Expand]Spreadsheet Formulas
    Defined Names
    Data Binding
    Data Validation
   [Expand]Data Presentation
    Data Grouping
   [Expand]Pivot Table Overview
   [Expand]Charting Overview
    Printing
    Events
   [Expand]Mail Merge Overview
    Protection
    Find and Replace
   [Expand]Visual Elements
    Services
   [Expand]Shortcuts
   [Expand]Examples
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Error Types

If a cell contains a formula that cannot be calculated correctly, the cell's value (Range.Value) is of the error type (the CellValue.IsError property value is true). To access information on an error contained in a cell, use the members of the ErrorValueInfo object returned by the CellValue.ErrorValue property. The ErrorValueInfo.Type returns the ErrorType enumeration member that specifies the error type, the ErrorValueInfo.Name property returns the error name displayed in a cell, and the ErrorValueInfo.Description property returns the cause of the error.

Error Type

Error Name

Error Description

Example

ErrorType.DivisionByZero

#DIV/0!

Division by zero!

cell.Formula = "= 10/0"

cell.Formula = "= A1/B2", the B2 cell is blank

ErrorType.Name

#NAME?

Function does not exist.

cell.Formula = "= FALS" - The function name used in the formula is not spelled correctly.

cell.Formula = "=SUM(A1B2)" - A colon (:) is missing in the cell range reference.

ErrorType.NotAvailable

#N/A

The value is not available to a function or formula.

cell.Formula = "= NA()"

cell.ArrayFormula = "=SUM(A1:A5*A1:B3)" - An array formula's arguments are arrays consisting of different numbers of elements.

ErrorType.Null

#NULL!

The specified intersection includes two ranges that do not intersect.

cell.Formula = "=SUM(A1:A5 E6:E8)" - The specified ranges do not intersect, so the sum cannot be calculated.

ErrorType.Number

#NUM!

Invalid numeric values in a formula or function.

cell.Formula = "=SQRT(-16)" - The square root of a negative number cannot be calculated.

ErrorType.Reference

#REF!

Cell reference is not valid.

A formula uses a reference to a cell, and then the column containing this cell is deleted:

cell.Formula = "=5+D2";

worksheet.Columns["D"].Delete();

ErrorType.Value

#VALUE!

The value used in the formula is of the wrong data type.

cell.Formula = @"= SUM(""text"", 6)" - The SUM function requires numeric arguments.

Expanded See Also

How would you rate this topic?​​​​​​​