Page 420 - Excel 2013 All-in-One For Dummies
P. 420

402 Statistical Functions
 I then used the sales_table range name in a number of formulas that count its different aspects. The most basic formula is the one that returns the total number of cells in the sales_table range. To build this formula in cell C10, I used the ROWS and COLUMNS information functions (see Book III, Chapter 6 for more on these types of functions) to return the number of rows and col- umns in the range, and then I created the following formula that multiplies these two values together:
=ROWS(sales_table)*COLUMNS(sales_table)
This formula, of course, returns 24 to cell C10. In the next formula, I calcu- lated the number of these 24 cells that contain data entries (of whatever type) using the COUNTA function. This function counts the number of cells that are not empty in the ranges that you specify. The COUNTA function uses the following syntax:
COUNTA(value1,[value2],[...])
The value arguments (all of which are optional except for value1) are up
to 30 different values or cell ranges that you want counted. Note that the COUNTA function counts a cell as long it has some entry, even if the entry is empty text set off by a single apostrophe (’). In the example shown in Figure 5-5, cell C11 contains the following COUNTA function:
=COUNTA(sales_table)
This formula returns 20 to cell C11. The next formula in the sample spread- sheet calculates the number of numeric entries in the cell range called sales_table. To do this, you use the COUNT function. The COUNT function takes the same arguments as COUNTA, the only difference being that COUNT counts a value or cell specified in its value arguments only if it contains a numeric entry.
Cell C12 contains the following formula for calculating the number of numeric entries in the Home Sales table range called sales_table:
=COUNT(sales_table)
Excel returns 10 to cell C11. Note that in calculating this result, Excel counts the five date entries (with the date of each sale) in the cell range B3:B7 as well as the six numeric data entries (with the selling prices of each home plus total) in the cell range C3:C8.























































































   418   419   420   421   422