VAL returns the numeric value of a text string. Text strings that contain a numeric value or a number with an MDL symbol (ie “<2”) will be converted to a number.
VAL(Value, optional Default_Value)
Value: Text value or Cell Reference
Default_Value: Optional. Displays optional default value when symbol has not been set up. Looks for first numerical value using a symbol (<,>,ND...ect) and displays the numerical value.
|Symbols are removed and the numeric part is converted to a number. |
||Cell C1 contains the string “<4”|
||VINFO is a text function that returns “15”, Val converts that to 15.0|
||Looks for first numerical value of symbol (<,>,ND). X is not a symbol that has been set up, therefore the default value (0) will be displayed.|
||Returns nothing since there is no default value and X is not a symbol or a number. |
||C2 is a blank cell.|
||Converts the numeric part until a non-numeric value is found.|
|VAL(" 123 Main, Hwy 74")
||Spaces removed and value up to first non-numeric is converted.|
||Returns 1 if D4 = "PASS" and the cell type will be numeric. Notice VAL overides the STR (which tries to make the cell type text) because VAL is the outer most function. |
||Returns "GOOD" if the Value of B4 < 10. Notice STR as the outer most function sets the cell type to text allowing GOOD (or BAD) to be displayed in the cell. |
SEE ALSO: NFNP, Qualifier