CELL (information about a cell)

<< Click to Display Table of Contents >>

CELL (information about a cell)

Syntax:

CELL(Type [, Reference])

Description:

This returns various types of information about a cell.

Type specifies the type of information to return. Type can be one of the following text strings:

Type

Explanation

"address"

This returns the address of the cell (as a text string).

"width"

(This is not supported and thus returns a #N/A error value.)

"filename"

This returns the full path and filename of the document that contains the cell.

"color"

This returns 1 if the cell uses the number format option Negative numbers in red, or 0 if not.

"format"

(This is not supported and thus returns a #N/A error value.)

"contents"

This returns the value stored in the cell.

"parentheses"

(This is not supported and thus returns a #N/A error value.)

"prefix"

This returns one of the following text strings:

' if the cell contains left-aligned text

^ if the cell contains centered text

" if the cell contains right-aligned text

\ if the cell contains fill-aligned text

"" if the cell contains anything else

"protect"

This returns 1 if the cell is protected, or 0 if not.

"col"

This returns the column number of the cell (as a number).

"type"

This returns one of the following text strings:

b (for blank) if the cell is empty

l (for label) if the cell contains text

v (for value) if the cell contains anything else

"row"

This returns the row number of the cell.

Reference (optional) is the address of the cell to be evaluated.

If Reference is a range of cells, only the top left cell will be evaluated.

If Reference is omitted, the current cell will be evaluated. (Excel behaves differently, see the note below.)

Compatibility notes:

This function is not fully identical to Microsoft Excel's CELL function. The following restrictions apply:

1. Some types of information are not supported by PlanMaker (see the table above).

2. If the parameter Reference is omitted, PlanMaker evaluates the current cell, whereas Excel evaluates the cell that was last changed.

Example:

=CELL("row", B5) returns the row number of cell B5, i.e., 5.

See also:

FILENAME, COLUMN, ROW