Calculate a Percent Diff p. 34
The number of decimal places that appear in the results of the formula depends on the width of the column the formula is in.
Don't worry that the percentages Excel calculates don't look like percentages. Later, in Chapter 6, we'll format the worksheet so the numbers look like percentages.
If the budgeted amount in a cell is 0, the formula for the percent difference will display the error message #DIV/0! Enter this formula in cell E3 to prevent that error: =IF(ISERR(D3/B3),0,D3/B3) This rather complex formula uses logic to determine whether the formula results in an error and, if it does, results in 0.
Get Creating Spreadsheets and Charts in Excel: Visual QuickProject Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.