0% found this document useful (0 votes)
156 views3 pages

Rows and Columns

The document provides examples of Excel functions such as ROWS, COLUMNS, ADDRESS, and CELL, highlighting their usage and differences. It explains how these functions can be applied in practical scenarios, including creating dynamic links between input scenarios and model outputs using functions like CHOOSE. Additionally, it discusses the implications of using volatile functions like CELL on computational efficiency.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
156 views3 pages

Rows and Columns

The document provides examples of Excel functions such as ROWS, COLUMNS, ADDRESS, and CELL, highlighting their usage and differences. It explains how these functions can be applied in practical scenarios, including creating dynamic links between input scenarios and model outputs using functions like CHOOSE. Additionally, it discusses the implications of using volatile functions like CELL on computational efficiency.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Example: the ROWS and COLUMNS Functions

The file Ch25.2.ROWS.COLUMNS.xlsx provides an example of the ROWS and


COLUMNS functions, which are also essentially self-explanatory (see Figure 25.2).
It is worth noting (for use later in this text) that, whilst ROWS(B3:D7) returns the
value 5 (i.e. the number of rows in the range), in VBA the statement Range("B3:D7").
Rows refers to the actual rows in the range (not to their number). It is the Count prop-
erty of this set of rows that would be used to find out the number of rows in a range:
NRows= Range("B3:D7").Rows.Count

Example: Use of the ADDRESS Function and the Comparison with CELL
The ADDRESS function returns the address of a cell in a worksheet, given specified
row and column numbers. Note that in Chapter 22, we saw that the CELL function
could also provide address-related (e.g. address, row, or column number) as well as
other information (e.g. its format or type of contents) about a cell.
The file Ch25.3.CELL.ADDRESS.1.xlsx shows an example of the ADDRESS func-
tion and the analogous result produced using the address-form of the CELL function
(see Figure 25.3).
Note (for later reference) that each function can be entered in a cell which ref-
erences itself without creating a circular calculation. It is also worth noting that the
CELL function has the Excel property that it is Volatile. This means that it is evaluated
at every recalculation of the worksheet even when its arguments have not changed,

FIGURE 25.3 Use of ADDRESS and Comparison with CELL


FIGURE 25.4 Finding the Address of Corresponding Cells in Another Worksheet

which reduces computational efficiency. Thus, the ADDRESS function may be chosen
in preference to the CELL function in some cases.
The file Ch25.4.CELL.ADDRESS.4.xlsx contains an example of the use of the
ADDRESS function (see Figure 25.4). It uses the last of the function’s optional argu-
ments to find the address of a cell in another worksheet of the workbook. In other
words, the ADDRESS function is providing (in Cell B3) the full address of Cell B3 of
the “Feb” worksheet. A similar result can be obtaining using the address form of the
CELL function by explicitly concatenating the text strings. (This approach will be
important for some examples of multi-sheet models shown later in the chapter, and
discussed in Chapter 6.)

PRACTICAL APPLICATIONS: FURTHER REFERENCING PROCESSES


Example: Creating Scenarios Using INDEX, OFFSET or CHOOSE
The use of scenario techniques essentially means that the values of several inputs are
changed simultaneously. This is usually an extension of sensitivity analysis, which at
its core involves changing the value of only one variable. Scenario techniques are
useful to begin to capture a wide set of possible outcomes, and to capture
dependencies between variables that are believed to exist but which are hard to
represent through full math- ematical relationships.
Once the scenarios have been defined with explicit data, for any given scenario,
the values that are to be used can be looked up from these data sets. The use of lookup
pro- cesses is an alternative to a “copy and paste” operation (in which model inputs
would be manually replaced by the values for the desired scenario), with the function
creating a dynamic link between the input scenarios and the model output.
The file Ch25.5.Scenarios.1.xlsx shows an example in which the CHOOSE
function is used (Row 6) to pick out the values that apply to the chosen revenue sce-
nario (see Figure 25.5). The desired scenario number is entered in Cell A6, and the
references values are linked into the model’s subsequent calculations (Row 10 being
linked to Row 6). Note that in principle the calculations in Row 6 could instead be
placed directly in Row 10. However, for large models such an approach would mean
that the CHOOSE function would refer to data that is physically separated from its
inputs in a more significant way, and thus be less transparent and more error-prone.
Note also that the CHOOSE function requires explicit referencing of the data of each
individual scenario.

You might also like