Home : Conditional Variable
Q10459 - INFO: Conditional Variable

In a Math Toolbox equation, designating variables with a V, such as V123, means that a value must exist for it before the equation can calculate.  An equation will not calculate if a value does not exist for every V-type variable used in the equation.  In such case, a blank will be printed in any of the reports for this calculation indicating that there was insufficient data to perform the calculation.

There is another method of designating a variable within an equation - as a conditional variable.  When a variable is declared a conditional variable, it means that if no value presently exists for the variable,  that term is ignored in the equation.  If an equation can be solved adequately without a value for a certain variable, that variable should be designated with a C, such as C124.

Differences between addition using V variables and addition using C variables :

V1

V2

V1+V2

C1+C2

1

2

3

3

-

2

-

2

-

-

-

-

0

2

2

2

0

0

0

0

"-" denotes a blank value

In summary, those variables essential to the calculation of an equation should be given a V-type designation.   Variables not essential to the calculation of the equation should be given a C-type designation.  When using variables in functions (i.e. WAVG, DDIF, ...) refer to help topic on the function to determine when to use a C or a V.

NOTES:

  • When multiplying, dividing, or raising a number by a Conditional reference where the value is blank, the value calculated will be blank and the equation will continue to be evaluated. 
  • When adding or subtracting a Conditional reference to a number when the value is blank will return that number and  the equation will continue to be evaluated.

Examples:

V1

V2

V1*C2

V1*C2

V1 * C2 +10

1

2

2

2

12

-

2

-

-

-

-

-

-

-

-

1

-

-

-

10

0

0

0

0

10

"-" denotes a blank value

SEE ALSO: IF (Conditional statement)ISBLANK

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 10/1/2007 11:33 AM.
Last Modified on 3/2/2020 11:44 AM.
Last Modified by Scott Dorner.
Article has been viewed 5007 times.
Rated 5 out of 10 based on 4 votes.
Print Article
Email Article