CHAPTER 15 Digging Up the Facts 299
TABLE15-1 Selecting the First Argument for the CELL Function
Argument Example Comment
address =CELL("address") Returns the address of the last changed cell.
col =CELL("col",Sales) Returns the column number of the rst cell in the Sales
range.
color =CELL("color",B3) Tells whether a particular cell (in this case, cell B3) is format-
ted in such a way that negative numbers are represented in
color. The number, currency, and custom formats have
selections for displaying negative numbers in red. If the cell
is formatted for color-negative numbers, a 1 is returned;
otherwise, a 0 is returned.
contents =CELL("contents",B3) Returns the contents of a particular cell (in this case, cell B3).
If the cell contains a formula, returns the result of the for-
mula and not the formula itself.
filename =CELL("filename") Returns the path, lename, and worksheet name of the
workbook and worksheet that has the CELL function in it (for
example, C:\Customers\[Acme Company]Sheet1). The
function results in a blank answer in a new workbook that
has not yet been saved.
format =CELL("format",D12) Returns a cell’s number format (in this case, cell D12). See
Table15-2 for a list of possible returned values.
parentheses =CELL("parentheses",
D12)
Returns 1 if a cell (in this case, D12) is formatted to have
either positive values or all values displayed with parenthe-
ses. Otherwise, 0 is returned. A custom format is needed to
make parentheses appear with positive values in the rst
place.
prefix =CELL("prefix",R25) Returns the type of text alignment in a cell (in this case, cell
R25). There are a few possibilities: a single quotation mark (’)
if the cell is left-aligned; a double quotation mark (") if the cell
is right-aligned; a caret (^) if the cell is set to centered; or a
backslash (\) if the cell is ll-aligned. If the cell being evalu-
ated is blank or has a number, the function returns nothing.
protect =CELL("protect",D12) Returns 1 if a cell’s protection (in this case, cell D12) is set to
locked; otherwise, a 0 is returned. The returned value is not
aected by whether the worksheet is currently protected.
row =CELL("row",Sales) Returns the row number of the rst cell in the Sales range.
type =CELL("type",D12) Returns a value corresponding to the type of information in
acell (in this case, cell D12). There are three possible values:
b if the cell is blank; l if the cell has alphanumeric data; and
vfor all other possible values, including numbers and errors.
width =CELL("width") Returns the width of the last changed cell, rounded to an
integer. For example, a width of 18.3 is returned as 18.