cellMatrix.net

Spreadsheet Modeling and Related Topics

Percent Change Error Trap

To keep the percent change formula from returning errors and/or extreme values, consider a nested IF statement to trap errors or values that fall outside of a certain range. In the example below, "n/a" refers to "not applicable". Errors have been trapped in lines one through three. In line four, the formula returns "n/a" because the absolute value of the change is greater than 200%. This logic is written into the formula to prevent it from returning exteme values.

image

The formula in G4 is below. It is copied from cell G4 into cells G6, G8, G10, and G12.

=IF(OR((E4=0),(F4=0)),"n/a",IF(ABS(F4/E4-1)>2,"n/a",(F4/E4-1)))
Posted on Friday, April 11, 2008 | Comments (2) | Permalink
Comments

The second IF looks incomplete… it has greater than, without an argument.

If the error you get in the first if is a div by zero, you can simplify by using =IF(F4=0,“n/a”, etc.

Posted by Jon Peltier  on  04/15  at  02:42 PM

Jon,

Thanks for catching that error . . I’ve made the correction.

John

Posted by .(JavaScript must be enabled to view this email address)  on  04/16  at  08:04 PM
Page 1 of 1 pages

Comment Entry Form

User Information

Name: (Required)

E-Mail Address: (Optional)

Location: (Optional)

Web Site Address: (Optional)

Comment Formatting Reference
Add VBA Code:
<pre>some code here</pre>
Linking:
[url]http://www.example.com/[/url]
[url=http://www.example.com/]my site[/url]
Text Formatting
[size=4]Some larger text[/size]
[color=green]Some green text[/color]
[b]Some bold text[/b]
[i]Some italic text[/i]
Enter Comment Below

Personalization Options
Remember my personal information
Notify me of follow-up comments?

Next entry: Pivot Table Difference Between Columns

Previous entry: Simple Goal Seek Procedure

<< Back to main

Statistics

  • Total Entries - 136
  • Current Viewers - 22

Categories

Entries by Day

Sep - 2010
S M T W T F S
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 1 2

Recent Comments

Syndicate