Seeing Signs

Problem

You want to capture only the sign of an expression, not its value. Or you want to take the absolute value of an expression.

Solution

Use the SIGN function in the former case and the ABS function in the latter case.

Discussion

Situations often arise in scientific calculations when you're more interested in the sign of an expression than in the resulting value. For example, the formula

=$F3-$E$8/(ABS(G$2/$F$2))*ABS(G$2/$F$2)^0.1*SIGN(G2-F2)

uses the SIGN function to compute the algebraic sign of the expression (G2-F2) and multiplies the rest of the formula by that sign (as a unit value). If (G2-F2) evaluates to a negative value, then the formula is multiplied by -1; if (G2-F2) evaluates to a positive number, then it is multiplied by +1 instead.

In this particular case, the expression (G2-F2) represents some change in value of a dimensional parameter and the direction of that change (i.e., positive or negative) is used as a scale factor to scale some other parameter from a baseline using an empirical formula. In other examples, you may be interested in whether some value is greater or less than zero, which you can determine by checking the sign of the value. The SIGN function allows you to perform such a check very easily and use the result in other computations or logical functions like the IF function.

You'll notice that in the example formula discussed a moment ago, I also used the absolute value function, ABS. The syntax for this function is =ABS(value or expression), where you can supply a value, cell reference, or some mathematical expression.

Using Excel

Getting Acquainted with Visual Basic for Applications

Collecting and Cleaning Up Data

Charting

Statistical Analysis

Time Series Analysis

Mathematical Functions

Curve Fitting and Regression

Solving Equations

Numerical Integration and Differentiation

Solving Ordinary Differential Equations

Solving Partial Differential Equations

Performing Optimization Analyses in Excel

Introduction to Financial Calculations

Index





Excel Scientific and Engineering Cookbook
Excel Scientific and Engineering Cookbook (Cookbooks (OReilly))
ISBN: 0596008791
EAN: 2147483647
Year: N/A
Pages: 206
Authors: David M Bourg
Similar book on Amazon

Flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net