Formulas and Functions

Table Of Contents
Chapter 9 Reference Functions 2 11
COLUMNS
The COLUMNS function returns the number of columns included in a specied range
of cells.
COLUMNS(range)
 range: A range of cells. range is a reference to a single range of cells, which may
contain values of any type.
Usage Notes
If you select an entire table row for  range, COLUMNS returns the total number of
columns in the row, which changes when you resize the table.
Examples
=COLUMNS(B3:D10) returns 3, the number of columns in the range (columns B, C, and D).
=COLUMNS(5:5) returns the total number of columns in row 5.
Related Topics
For related functions and additional information, see:
ROWS on page 221
Listing of Reference Functions on page 206
Value Types” on page 36
The Elements of Formulas” on page 15
“Using the Keyboard and Mouse to Create and Edit Formulas” on page 26
“Pasting from Examples in Help” on page 41
HLOOKUP
The HLOOKUP function returns a value from a range of rows by using the top row of
values to pick a column and a row number to pick a row within that column.
HLOOKUP(search-for, rows-range, return-row, close-match)
 search-for: The value to nd. search-for can contain any value type.
 rows-range: A range of cells. range is a reference to a single range of cells which
may contain values of any type.
 return-row: The row number from which to return the value. return-row is a number
value and must be greater than or equal to 1 and less than or equal to the number
of rows in the specied range.
 close-match: An optional value that species whether an exact match is required.