IIn this chapter, we take a look at some of the practical tools, functions, and formulas commonly used in financial modelling in Excel.
Excel now contains close to 500 different formula codes, called functions. The most commonly used function is SUM, which totals a range of cells. Most Excel users only use a very small percentage of the available functions, and many of them are irrelevant for use in finance and financial modelling. It is impossible to go over all of them here, but we will cover the ones that are going to be the most useful in using Excel for business analysis and financial modelling.
In most cases, you will find it easiest to use the Insert Function dialog box, accessible via the Insert Function button on the Formulas tab as shown in Figures 5.1 (for Windows) and 5.2 (for Mac). Alternatively, you can hit the little fx icon located to the left of the formula bar.
Note that the Insert Function dialog box (which used to be called the Function Wizard in previous versions of Excel) is called the Formula Builder in Excel for Mac; however, we will refer to it as the Insert Function dialog box in this book for consistency.
It's fair to say that some Excel users simply use the tool as a fancy calculator. If so, you'd be just using a formula in Excel, such as . This is fine, but in order to build financial models, you'll need to do a lot more than that! There are many predefined formulas in Excel, such as IF, SUM, VLOOKUP, INDEX (and several hundred more). These are referred to as functions.
So, you could write a formula containing a function, like , or you could just write a simple formula that does not contain a function, like . Many of us use the words formula and function interchangeably, but they do have slightly different meanings.
Because there are so many hundreds of functions in Excel, you should familiarise yourself with as many as possible, so that you know what is available.
For use in business and financial modelling, the most useful functions fall into the categories of logical, aggregation, lookup, and financial. The most commonly used functions in financial modelling are listed here:
There is a lot more to becoming a skilled modeller, however, than simply knowing lots and lots of functions in Excel. Often there are several functions which will achieve the same or similar results, so choosing the right function in the correct context takes practice. Use the simplest formula to perform the task you need it to do. Choose one that is not overly complicated and don't try to do too much in one cell. If it starts getting difficult to decipher, consider breaking the formula into several parts. See “How Long Should a Formula Be?” in Chapter 4 for an example of this.
As with most tools in financial modelling, you should choose the simplest option—not because you don't know how to do a more sophisticated function, but because you want to make the model as clear, simple, and transparent as possible. However, you still need to arm yourself with as many different functions as possible. Thus, the more you know, the more options you have available to you, and the more likely you are to find the best solution.
For example, Figure 5.3 shows the calculation of a compound growth rate when escalating the starting sales number by 5 percent to the power of the year. In order to do this, we've had to insert a helper row to link to. This makes the formula easier to follow, but a helper row is distracting and makes the model look messy, so it needs to be hidden. The entire row cannot be hidden in this instance, so we'd probably change the font to a pale grey to make it less distracting.
Alternatively, we can achieve the same result without the helper row, as shown in Figure 5.4, by calculating it all in one cell. Instead of inserting 1, 2, 3, and so on across the top, we can do the entire calculation in one cell by looking at the difference between the years; in this case, 2020 minus 2020 equals zero, and 2021 minus 2020 equals one, and so on.
Using the second method, the value 1 in the helper row has been replaced by the formula (C9-$B$9). This makes the second formula more difficult to follow, but the model is less cluttered.
This is an example of how a modeller needs to strike the balance between having a streamlined model, yet with formulas that are easy to follow.
Either of these methods would be perfectly acceptable, but as this is not a terribly long or complicated formula, the second option is preferable in my opinion because it avoids the addition of a potentially confusing helper row. For more detail on using different escalation methods in financial models, see the section on “Escalation Methods for Modelling” in Chapter 9.
There are currently still several different versions of Excel available in Microsoft Windows that modellers are likely to be using. Each time an updated version of Excel is launched, new features are introduced and subtle changes in the look and feel take place. The biggest change was way back when the big jump from Excel 2003 to 2007 occurred. The introduction of the ribbon and change of file types caused all sort of difficulties for heavy-duty Excel users, financial modellers included. In the versions since then, the changes have been somewhat less traumatic for users and in recent years Microsoft has been moving towards a subscription-based model, making the changes incrementally rather than all at once.
Historically, Microsoft has always sold a “perpetual” licence that is purchased outright and owned forever. With this type of licence, the user does not receive any updates to their software until the next version is released and installed. Large organisations with many users that have purchased perpetual licences often wait several years before upgrading—due to the cost—and are usually at least one or two versions behind. This means that at any one time there has always been a wide range of versions in use in the general community. It is not unusual for me to run a public training course and have three or four different versions of Excel being used by different participants in the class. As a consultant, I have always had to take care to find out the oldest version of Excel the client is likely to be using and make sure that I don't use any features or functions in the model that won't work in their version of Excel.
Users with perpetual licences understandably become impatient because they don't have access to new features they have seen or heard about, or because they cannot view or use the new features those with later versions have included in a model. When the upgrade finally does happen, the updates so eagerly anticipated by some can cause confusion and frustration for others, either because they dislike the sudden new look or can't find what they are looking for.
With subscription-based Office 365, updates are regularly released and any changes are gradual, which makes it easier for users to become accustomed to the differences. Organisations on the subscription model can choose their “update channel”, which will determine how often updates are made, either monthly or semi-annually. In theory, all versions should be the same, but these differences in the frequency of updates mean that not all users receive the updates at the same time.
Whilst it is possible to purchase an Excel 2019 licence, Microsoft is strongly encouraging users and organisations to take up the subscription option, presumably because they prefer the recurring revenue and stable cash flow it generates. As more organisations move to this model, the compatibility problem of users being on different versions will become less of an issue and should make my life as a trainer and consultant a lot easier! To seal the deal, Microsoft announced in 2017 than those running Office 2016 on a perpetual licence will be unable to connect to Microsoft's cloud-based services after 2020, and I expect 2019 will have similar limitations. It seems likely that Office 2019 will be the last version that Microsoft offers as a perpetual licence.
If you are building financial models or spreadsheets in Excel that other people with prior versions need to use, then you need to find out which version of Excel they are using and consider their version capabilities when building your models. For example, a model containing a TreeMap chart will simply not show at all in a version of Excel prior to 2016—in fact, all they will see is a white, blank square where the chart should be. Some of the biggest culprits are often new functions—it's very frustrating to build a model with a TEXTJOIN function, only to discover that the model user sees a #N/A error instead of the function result. For this reason, you'll save yourself some trouble when building a model if you don't include features in the first place that are not supported in the version of Excel in which it might be used. The problem is that we don't often know which features are included in which version.
To help you with this, here are some of the features that were introduced in various versions over the past decade or so.
Excel 2019/365 The following features were introduced in Excel 2019 or for those with an Office 365 subscription:
Note that you must have either Excel 2019 or Excel 365 to use the tools listed above. If a model containing any of these new features is opened in a previous version of Excel, in most cases you'll be able to view the feature, just not make any changes to it. With new functions, however, the formula will simply stop working if opened in a non-compatible version of Excel, which will undermine the functionality of the model—unless viewed using Excel Online. So, if you are building models in Excel that other people with prior versions need to use, then you need to consider the version capabilities as you build.
Excel 2016 Lots of new features were introduced in Excel 2016 and here are some of the most useful:
Excel 2013 Similarly, here are some of the most useful features that were added in Excel 2013:
Excel 2010 The following features were introduced in Excel 2010:
Which Features Cause Compatibility Problems? Below is a summary of commonly used new features which were first introduced in different versions and should be avoided, depending on which version your user has. Of course, you don't need to worry about avoiding any of these if everyone who might possibly ever open the model is using the same version of Excel. If it's a financial model only used internally, and your entire company is on Office 365, then go ahead and use IFS or SWITCH to your heart's content. But if you have cause for concern regarding compatibility, then you should avoid new features which were first introduced in a version more recent than the one your model users are on.
Version | Feature |
Excel 2019/365 |
|
Excel 2016 |
|
Excel 2013 |
|
Excel 2010 |
|
As more users move towards Excel 365 subscriptions, compatibility issues will become less of a problem. For more detailed explanations of the changes between versions and how they impact model building, please see www.plumsolutions.com.au/book to download supplementary material in PDF format. This section also discusses the difference between using Windows and Mac for financial modelling.
This book assumes readers are using Windows Excel 2019, but in most cases, instructions for previous versions and Excel for Mac have also been provided.
Working in Excel—particularly for the purpose of financial modelling—can be very time-consuming; increasing your speed and accuracy will increase productivity significantly. Excel users just starting out with Excel would be very comfortable with using the mouse for navigation and editing purposes. However, with growing familiarity, the mouse is not the fastest or most efficient way of modelling. Excel offers a lot of shortcuts to tackle this problem, and as you become faster, you will find them very handy.
There are many advantages to using Excel shortcuts:
Table 5.1 is a small selection of some of the most common and particularly useful shortcuts that are invaluable when using Excel for financial modelling. Note that a printable list of these shortcuts is also available at www.plumsolutions.com.au/book.
TABLE 5.1 Useful Windows Keyboard Shortcuts for Financial Modellers
Editing | |
CTRL+S | Save workbook |
CTRL+C | Copy |
CTRL+V | Paste |
CTRL+X | Cut |
CTRL+Z | Undo |
CTRL+Y | Redo |
CTRL+A | Select all |
CTRL+R | Copies the far left cell across the range |
CTRL+D | Copies the top cell down the range |
CTRL+B | Bold |
ALT+TAB | Switch program |
ALT+F4 | Close program |
CTRL+N | New workbook |
SHIFT+F11 | New worksheet |
CTRL+W | Close workbook |
ALT+E+L | Delete a sheet |
CTRL+TAB | Switch workbooks |
Navigating | |
CTRL+9 | Hide row |
SHIFT+CTRL+9 | Unhide row |
SHIFT+Spacebar | Highlight row |
CTRL+Spacebar | Highlight column |
CTRL+Minus sign | Delete selected cells |
Arrow keys | Move to new cells |
CTRL+Pg Up/Down | Switch worksheets |
CTRL+Arrow keys | Go to end of continuous range and select a cell |
SHIFT+Arrow keys | Select range |
SHIFT+CTRL+Arrow | Select continuous range |
Home | Move to beginning of line |
CTRL+Home | Move to cell “A1” |
SHIFT+ENTER | Move to cell above |
TAB | Move to cell to the right |
SHIFT+TAB | Move to cell to the left |
ALT+Down arrow | Display a drop-down list |
Formatting | |
CTRL+1 | Format box |
ALT+H+0 | Increase decimal |
ALT+H+9 | Decrease decimal |
SHIFT+CTRL+B | General format |
SHIFT+CTRL+! | Number format |
SHIFT+CTRL+# | Date format |
SHIFT+CTRL+$ | Currency format |
SHIFT+CTRL+% | Percentage format |
In formulas | |
F2 | Edit formula, showing precedent cells |
ALT+ENTER | Start new line in same cell |
SHIFT+Arrow | Highlight within cells |
F4 | Change absolute referencing (“$”) |
ESC | Cancel a cell entry |
= (equal sign) | Start a formula |
ALT+= | Sum selected cells |
CTRL+' | Copy formula from above cell |
F9 | Recalculate all workbooks |
SHIFT+CTRL+Enter | Enter array formula |
ALT+M+P | Trace immediate precedents |
ALT+M+D | Trace immediate dependents |
ALT+M+A+A | Remove tracing arrows |
CTRL+[ | Highlight precedent cells |
CTRL+] | Highlight dependent cells |
F5+Enter | Go back to original cell |
SHIFT+CTRL+{ | Trace all precedents (indirect) |
SHIFT+CTRL+} | Trace all dependents (indirect) |
Note that if you are using a laptop, you will often need to hold down the Function (Fn) key for the function keys across the top of the keyboard to work correctly. For example, in Table 5.1, where it says to use F2 to edit and show formulas, on many Mac as well as Windows laptops, you'll need to hold down Fn + F2 for this shortcut to work. You can change the settings on your laptop to change this if you prefer your function keys to behave as standard.
Almost all of the keyboard shortcuts that are available for Windows are available on the Mac version as well. If you are new to Mac, remember that in most cases, Command replaces Control, and Option replaces Alt.
Note that additional shortcuts in Excel for Mac may be created manually through System Preferences.
Formula consistency is critical for fundamental best practice, both in financial modelling and any other sort of analysis using Excel, for that matter. In order to have consistent formulas across and down the block of data, you need to understand how cell referencing works. Whilst this is a very basic feature of Excel that is taught in introductory Excel courses, it is surprising how many modellers don't understand its importance.
The “$” sign in a cell referencing tells Excel how to treat your references when you copy the cell. If there is a dollar sign in front of a row number or column letter, the row or column does not change when you copy it. Otherwise, it does change.
Cell references are relative, by default. This means that when you copy the cell, it will change. In Figure 5.6, we have created a calculation in cell B3 which refers to the price in cell B2. When cell B2 is copied down, the reference will change to and so on, down the row, which is not accurate.
However, if you want the formula to anchor itself to cell B2, you'd need to use absolute referencing. So, if you wanted to calculate the price below of $450 at various numbers of units, you'd need to anchor the cell reference to the price as shown in Figure 5.7.
This means that when you copy the formula down, as shown in Figure 5.8, the reference to cell A3 is relative, and changes to A4, A5, or wherever you paste it, but $B$2 remains anchored to cell B2 because it is an absolute reference.
To illustrate further, suppose the following formulas are in cell B3 and you copy them to cell B4. Here are the results in each case:
copies as: | ||
copies as: | ||
copies as: | ||
copies as: |
The “$” sign anchors a row number or column letter when you copy it. You can anchor both the column and the row (this is absolute referencing), or you can anchor one or the other (called mixed referencing).
In summary:
Excel allows you to select a single cell or a range of cells, and give it a name. You can then use the name to move to the cells and select them, or include them in a formula.
In the last section in Figure 5.7, we used an absolute reference to anchor our formula to the consistent price of $450.
This cell is called B2, and this won't change; however, we can also change the name of it to something else.
Those new to named ranges sometimes struggle to see the benefits of including them in models. It's true that most of the time named ranges are not entirely necessary, but there are some good reasons to use named ranges when building a model:
Finding, Using, Editing, and Deleting Named Ranges Clicking on the drop-down arrow next to the name will show all the defined names in the workbook (as shown in Figure 5.12). Clicking on the name will take you directly to the cell(s).
Excel will then move to and select the range. It doesn't matter what sheet you are in when you select the name. This can make finding your way around the named ranges in a model much faster.
Having created a range name, you can now use that name in a formula instead of cell references. For example, if you have created the range name called TotalIncome for the cell containing the total income result, and a range named TotalExpenditure for the cell containing the total expenditure result, you can create a formula (just by typing this text into a cell).
Another example. If you have created the range name Costs for all the cells in a column containing your numerical costs data, you can calculate the total costs using the formula .
A cell does not need to be an input field in order to assign a name to it, although it often is in financial models. The cell can also contain a formula as well as a hardcoded input value.
Named ranges can be useful, but it's not good practice to have too many. They can be confusing, especially if you have not used a consistent naming methodology. It's also quite easy to accidentally name the same cell twice. So, in order to keep the names neat and tidy, you might need to edit or delete them.
Also, if you have added more data to a spreadsheet, and a range name no longer expresses the correct range of cells, you can redefine the named range.
Now that we understand the basics of formulas and functions in Excel, it is time to start looking at some of the basic Excel functions. With financial modelling—or any other use of Excel for that matter—it is highly unlikely that the entire range of Excel functions will get used. However, the more functions we know, the better equipped we are to translate our business logic into a highly functional, dynamic, and robust financial model.
There are some common basic functions that are used frequently, and understanding them is important for any modeller. Some of the basic mathematical functions included in the Excel suite are: SUM(), MAX(), MIN(), COUNT(), and AVERAGE(). The function names are indicative of the functions they perform.
This function is used to sum up a series of numbers. You can add individual cells, by separating them with commas, and you can also specify a range of cells. Figure 5.13 is an example of using a comma in the SUM function.
This function helps to identify the maximum value. The syntax for this function is very similar to SUM(); you can enter a range of cells, individual cells separated by commas, or a combination of both. This function will return an error if the cells you need to analyse have some text that cannot be converted appropriately. Similarly, if the cells do not contain any numbers, the function returns 0. See Figure 5.14 in which the maximum average monthly temperatures have been calculated for various cities around the world.
This function is the inverse of the MAX() function, giving the least value in the list. The MIN() function can also use any combination of ranged series and individual cells. The limitations on inputs and the results are similar to the MAX() function. In Figure 5.15, the MIN() function has been used to calculate the minimum average monthly temperatures.
As the name suggests, this function calculates the average, or mean, of the numbers in the list. AVERAGE() is a very useful function in certain situations, as can be seen in Figure 5.16.
These basic functions can be used individually to calculate the respective results, but they can also be used in combination for various calculations. For example, if you want to find the maximum deviation (or range of values) in the values, you could subtract the maximum and minimum value. So you would have a formula such as , as shown in Figure 5.17.
Excel allows you to include more than one function in a formula. For example, you can add two totals using the formula
but this does not make it a nested formula.
A nested formula is one in which a function is included in the field of another function. This technique allows you to build more complex formulas. Fields appear in parentheses after the function. Some functions require several fields; some require only one. A field can be a number, a reference, or text (usually in inverted commas). If a formula has more than one field, they will be separated by commas.
Some examples follow. This formula has one field range:
This formula has three fields; a reference, text, and another reference:
Finally, we have an example of a nested function, containing another function in a field. This one calculates the average of two totals:
See the section “Nested IF Statement” later in this chapter for more examples on how to build nested formulas.
Logical functions, particularly IF statements, are very commonly used in financial models because they allow the user to turn on and off certain calculations, and to create scenarios and certain conditions or thresholds for calculations to maintain. Because of their common usage in financial models, we'll be focusing on logical functions for the rest of this chapter.
The IF statement takes three fields (Excel calls them arguments, but I'm going to stick with the term “field”):
The syntax, therefore, looks like this:
The first field consists of a logical expression (i.e., something that, when evaluated, is either TRUE or FALSE). The expression in the first field is evaluated. If it is TRUE, then the IF statement returns the value of the second field. If it is FALSE, then the IF statement returns the value of the third field.
Consider the following example:
The statement being tested is TRUE, so the “greater” value is returned. Try this out, using the Insert Function dialog box, if you're new to IF statements.
Consider another example:
The first expression is false, so the “less than” value is returned.
Practical Example 1 Let's look at a practical example of an IF statement in a financial model. In the valuation model shown in Figure 5.18, we have decided that if the value of the deal is greater than the cost of the deal, then we should accept it, otherwise, we should reject it. The syntax is , and because the value is greater than the cost, it will return the decision “Accept”. If any of the inputs in this model change, such that the value becomes lower than the cost, then the formula will automatically show “Reject” instead.
Practical Example 2 Here's another practical example of using an IF statement in a financial model, but this time in a consistent block of data. If you had a list of projects as shown in Figure 5.19, and wanted to show these in a spend schedule, you could use the IF function in cell D3 to do this:
Because mixed referencing has been used, you'll be able to copy the formula in cell D3 all the way across the block of data. You can try this out for yourself by recreating this sheet or a template can be found, along with the accompanying models to the rest of the screenshots in this book, at www.plumsolutions.com.au/book.
IF statements can also be nested, meaning that it is possible to have an IF statement inside another IF statement. The IF function is normally used to test a cell and perform two different actions, depending on the outcome of the test. But by nesting another IF function inside an IF function, you can test a cell and perform three different actions depending on the outcome of the tests.
For example:
The first field is TRUE so the second field is then evaluated. Because the second field is also true, it returns its second field. Hence, the result for this formula is both.
Test this formula in Excel and enter criteria in the first field such that it returns second and first.
Whilst you'll still see this type of function used in financial models, note that nesting an IF using this method has now been superseded by the IFS function. See the “IFS Function” section in this chapter for further information.
The AND statement tests statements you enter and returns TRUE only if all the logical expressions are TRUE.
For example:
Both of these fields are true, so the result of the formula will be TRUE.
For example:
Only one of these fields is true, so the result of the formula will be FALSE.
The AND statement is most commonly used in conjunction with IF as a nested function. For example:
Only if both of the fields are true will the second field be returned. If one or both is false, then the third will be returned.
The result of this formula is A, because both AND fields are TRUE.
The OR statement is very similar to the AND statement except that either field can be true, rather than both.
For example:
However:
In basic terms, a nested function is a function within a function, and the IF statement is probably most commonly used as a nested function. Prior to the introduction of the IFS function, modellers would often need to nest many IF statements together—in fact, it is possible to actually nest up to 64 functions within a formula model, however, this is not recommended, and certainly not good modelling practice.
Nesting IF and AND Functions A common nested formula is to nest an IF and an AND function together to test whether or not a certain date or value falls within certain parameters. Let's take a look at a practical example of a useful nested IF formula. You can create this sheet yourself or a template can be found, along with the accompanying models to the rest of the screenshots in this book, at www.plumsolutions.com.au/book.
In the example shown in Figure 5.20, we need to forecast the staff costs over the 10-year period, based on start date and end date. There is no BETWEEN function in existence (yet), but we can calculate this with a nested formula www.plumsolutions.com.au/book
Start by evaluating the start date only, ignoring the end date for now. By following these seven steps, let's build an IF statement that will show the cost only if the date in the schedule is greater than, or equal to, the start date of the employee.
Now that we've tested and checked this formula and are confident that it's giving the correct results based on the start date, we can go back to cell G7 and add in the end date. We want to test whether the current date (2020) falls between the start date (2020) and the end date (2029), so we can use the AND function to test if 2020 is greater than or equal to 2020 and also less than or equal to 2029:
Of course, we aren't going to hardcode in the dates, so we'll use the cell references instead.
Auditing a Nested Formula With most functions, we recommend the use of the Insert Function dialog box; however, the Insert Function dialog box does not easily work with nested formulas, and as your formulas get more complex, you need to know the syntax of the formula before attempting to nest it. Because an IF statement is one that is very commonly nested, it is important that you know the IF function syntax.
Nesting Multiple IF Statements Let's take a look at another example of a useful nested IF formula. You can try this out for yourself by recreating this sheet or a template can be found, along with the accompanying models to the rest of the screenshots in this book, at www.plumsolutions.com.au/book. In the pricing table shown in Figure 5.24, the price varies depending on how many items are purchased.
If you bought 63 items, you can see that they would be $10.50 each. If you want to create an automatic calculation for this, you'd need to create a nested formula, starting with the following three steps:
So, the following rules will apply for the formula in cell B8:
Thus, the formula tests cell A1 to see if it is greater than or equal to five. If it is less than five, the formula will stop there and return the first value if true. If it is greater than five, however, it is then tested again to see if it is greater than or equal to 50. If it is, it will stop there and return the second value if true. If it is greater than five and greater than 50, only then will it return the value if false.
IFS Function An easier way to complete this would be using an IFS function, which was first introduced in Office 365. Rather than breaking it down into several steps, using the IFS function is a much easier way to achieve this result, as it can be done in one step using the Insert Function dialog box. Unlike the nested IF function, where you need to build a separate IF function for each part of the formula, the IFS function allows you to evaluate each section individually within the dialog box:
In a nested IF statement, we would then just add a “value if else” here, but with the IFS function, you need to give it a third set of criteria to evaluate.
Note that a nested IF statement or IFS function is an appropriate formula to use in this situation. However, if there were more than three pricing steps in the table, it is recommended that you use a close match VLOOKUP or LOOKUP function instead, as this is a much simpler function than nesting multiple IF statements. (See the section “Building a Tiering Table” in Chapter 9 for how to do this.) Basically, if you find yourself including more than two or three IF statements in a formula, consider whether the formula should be broken into several steps, or whether an alternative, simpler function should be used instead.
This chapter introduced the more basic tools and functions that are commonly used in financial modelling, such as basic functions, cell referencing, and named ranges. We also covered functions such as IF, SUM, AVERAGE, and nesting these, as well as useful shortcuts that will make your model-building faster and more accurate. The fundamental techniques of using cell referencing for best practice, as well as the use of named ranges, are the critical basic knowledge required for financial modellers before moving on to more advanced tools. The Windows and Mac shortcuts named here will also prove invaluable to increasing your speed, productivity, and accuracy as a financial modeller.
3.145.101.81