[Table of Contents] [docx version]

SpreadsheetML Reference Material - Table of Contents

TYPE

Syntax:

TYPE ( value )

Description: Computes the type of value or, if value is a reference to a single cell, the type of the value in that cell.

Arguments:

Name

Type

Description

value

any

The value whose type is to be determined. No conversion shall take place on an argument passed to this function.

 

Return Type and Value: number – An integer that indicates the type of value or, if value is a reference to a single cell, the type of the value in that cell, as follows:

Type of value

Value Returned

number

1

text

2

logical

4

error value

16

array of any kind

64

 

[Example:

TYPE(10.5) results in 1
TYPE(A10) results in 1, when A10 contains a number
TYPE("ABC") results in 2
TYPE(A10) results in 2, when A10 contains a string
TYPE(TRUE) results in 4   
TYPE(A10) results in 4, when A10 contains a logical value

TYPE(5/0) results in 16   
TYPE(A10) results in 16, when A10 contains any error value
TYPE({1,2,3}) results in 64
TYPE({TRUE,2.5,#N/A}) results in 64
TYPE(IF(10>5,"Yes",20)) results in 2
TYPE(IF(10<5,"Yes",20)) results in 1

end example]