Difference between revisions of "Manuals/calci/IF"
Jump to navigation
Jump to search
| Line 14: | Line 14: | ||
*When <math>v_1</math> and <math>v_2</math> are calculated, IF returns the value returned by <math>v_1</math> or <math>v_2</math>. | *When <math>v_1</math> and <math>v_2</math> are calculated, IF returns the value returned by <math>v_1</math> or <math>v_2</math>. | ||
*If any of the arguments to IF are arrays,each element of the array is evaluated when the IF statement is carried out. | *If any of the arguments to IF are arrays,each element of the array is evaluated when the IF statement is carried out. | ||
| − | *We can use [[Manuals/calci/COUNTIF | COUNTIF ]] and [[Manuals/calci/SUMIF | SUMIF ]]functions for more to examine our data based on acondition. | + | *We can use [[Manuals/calci/COUNTIF | COUNTIF ]] and [[Manuals/calci/SUMIF | SUMIF ]] functions for more to examine our data based on acondition. |
==Examples== | ==Examples== | ||
Revision as of 03:30, 9 January 2014
IF(lt,v_1,v_2)
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle lt} is the logical test.
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle v_1} and Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle v_2} are the values
Decription
- This function gives one value when our specified condition is TRUE and the second value when our specified condition is FALSE.
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle IF } is the Conditional statement and it is used to perform different actions based on different conditions.
- In Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle IF(lt,v_1,v_2), lt } is the logical test or expression to evaluate.
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle v_1 } is any value or the string and it is displays when the specified Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle lt } is TRUE.
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle v_2 } is any value or the string and it is displays when the specified lt is FALSE.
- For e.g.,IF(A2>1000,"costly","cheap").Here A2>1000 is the logical expression. Costly is the Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle v_1} value and cheap is the Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle v_2} value.
- When our mentioned amount is satifying the lt then it shows "costly". Suppose our amount is not satifying the lt it shows "cheap".
- In CALCI we can give any number of IF functions can be nested as Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle v_1} and Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle v_2} statements to give for a complicated tests.
- When Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle v_1} and Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle v_2} are calculated, IF returns the value returned by Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle v_1} or Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle v_2} .
- If any of the arguments to IF are arrays,each element of the array is evaluated when the IF statement is carried out.
- We can use COUNTIF and SUMIF functions for more to examine our data based on acondition.
Examples
1.Number=20 IF(A2>=0,"positive","negative") =positive Number=-18 IF(A2>=0,"positive","negative")=negative
2.A1= IF(ISBLANK(A1)=TRUE,"BLANK",IF(ISTEXT(A1)=TRUE,"TEXT",IF(ISNUMBER(A1)=TRUE,"NUM","")))= BLANK
3. A1= winter IF(ISBLANK(A1)=TRUE,"BLANK",IF(ISTEXT(A1)=TRUE,"TEXT",IF(ISNUMBER(A1)=TRUE,"NUM",""))) = TEXT
4. A1=10000 IF(ISBLANK(A1)=TRUE,"BLANK",IF(ISTEXT(A1)=TRUE,"TEXT",IF(ISNUMBER(A1)=TRUE,"NUM","")))=NUM
5.C1=40,D1=90 IF(C1<D1,C1+D1,C1-D1) = 130