Difference between revisions of "Manuals/calci/IF"
Jump to navigation
Jump to search
| (14 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
| − | <div style="font-size:30px">'''IF( | + | <div style="font-size:30px">'''IF (condition,truepart,falsepart)'''</div><br/> |
| − | *<math> | + | *<math>condition</math> is the logical test. |
| − | *<math> | + | *<math>truepart</math> and <math>falsepart</math> are the values. |
| + | **IF(), specifies a logical test to perform. | ||
| − | == | + | ==Description== |
*This function gives one value when our specified condition is TRUE and the second value when our specified condition is FALSE. | *This function gives one value when our specified condition is TRUE and the second value when our specified condition is FALSE. | ||
*<math> IF </math> is the Conditional statement and it is used to perform different actions based on different conditions. | *<math> IF </math> is the Conditional statement and it is used to perform different actions based on different conditions. | ||
| − | *In <math> IF( | + | *In <math>IF (condition,truepart,falsepart)</math>, <math>condition </math> is the logical test or expression to evaluate. |
| − | *<math> | + | *<math> truepart</math> is any value or the string and it is displays when the specified <math> condition </math> is TRUE. |
| − | *<math> | + | *<math>falsepart </math> is any value or the string and it is displays when the specified <math>condition</math> is FALSE. |
| − | *For e.g | + | *For e.g, IF(A2>1000,"costly","cheap"). Here A2>1000 is the logical expression. Costly is the <math>truepart</math> value and cheap is the <math>falsepart</math> value. |
| − | *When our mentioned amount is | + | *When our mentioned amount is satisfying the <math> lt</math> then it shows "costly". Suppose our amount is not satisfying the <math>lt</math> it shows "cheap". |
| − | *In CALCI we can give any number of IF functions can be nested as | + | *In CALCI we can give any number of <math>IF</math> functions can be nested as <math>truepart</math> and <math>falsepart</math> statements to give for a complicated tests. |
| − | *When | + | *When <math>truepart</math> and <math>falsepart</math> are calculated, <math>IF</math> returns the value returned by <math>truepart</math> or <math>falsepart</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 <math>IF</math> are arrays, each element of the array is evaluated when the <math>IF</math> statement is carried out. |
| − | *We can use | + | *We can use [[Manuals/calci/COUNTIF | COUNTIF ]] and [[Manuals/calci/SUMIF | SUMIF ]] functions for more to examine our data based on a condition. |
==Examples== | ==Examples== | ||
1.Number=20 | 1.Number=20 | ||
| − | IF(A2>=0,"positive","negative") =positive | + | IF(A2>=0,"positive","negative") = positive |
Number=-18 | Number=-18 | ||
| − | IF(A2>=0,"positive","negative")=negative | + | IF(A2>=0,"positive","negative") = negative |
2.A1= IF(ISBLANK(A1)=TRUE,"BLANK",IF(ISTEXT(A1)=TRUE,"TEXT",IF(ISNUMBER(A1)=TRUE,"NUM","")))= BLANK | 2.A1= IF(ISBLANK(A1)=TRUE,"BLANK",IF(ISTEXT(A1)=TRUE,"TEXT",IF(ISNUMBER(A1)=TRUE,"NUM","")))= BLANK | ||
| Line 33: | Line 34: | ||
IF(C1<D1,C1+D1,C1-D1) = 130 | IF(C1<D1,C1+D1,C1-D1) = 130 | ||
| + | ==Related Videos== | ||
| + | |||
| + | {{#ev:youtube|RhuD0l080kg|280|center|IF FUNCTION}} | ||
==See Also== | ==See Also== | ||
| + | *[[Manuals/calci/AND| AND]] | ||
| + | *[[Manuals/calci/OR| OR]] | ||
==References== | ==References== | ||
| + | *[http://www.excel-easy.com/functions/logical-functions.html Logical functions] | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | *[[Z_API_Functions | List of Main Z Functions]] | ||
| + | |||
| + | *[[ Z3 | Z3 home ]] | ||
Latest revision as of 15:41, 3 August 2018
IF (condition,truepart,falsepart)
- 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 truepart}
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 falsepart}
are the values.
- IF(), specifies a logical test to perform.
Description
- 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 (condition,truepart,falsepart)} , 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 condition } 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 truepart} 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 condition } 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 falsepart } 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 condition} 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 truepart} 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 falsepart} value.
- When our mentioned amount is satisfying 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 lt} then it shows "costly". Suppose our amount is not satisfying 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 lt} it shows "cheap".
- In CALCI we can give any number of 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} 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 truepart} 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 falsepart} 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 truepart} 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 falsepart} are calculated, 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} 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 truepart} 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 falsepart} .
- If any of the arguments to 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} are arrays, each element of the array is evaluated when 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 IF} statement is carried out.
- We can use COUNTIF and SUMIF functions for more to examine our data based on a condition.
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
Related Videos
See Also
References