Difference between revisions of "Manuals/calci/IF"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "<div id="16SpaceContent" align="left"><div class="ZEditBox" align="justify"> Syntax </div></div> ---- <div id="2SpaceContent" align="left"><div class="ZEditBox" align=...")
 
Line 1: Line 1:
<div id="16SpaceContent" align="left"><div class="ZEditBox" align="justify">
+
<div style="font-size:30px">'''IF(l_t,v1,v2)'''</div><br/>
 +
*<math>l_t</math>is the logical test.
 +
*<math>v1</math> and <math>v1</math> are the values
  
Syntax
+
==Decription==
 +
*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.
 +
*In <math> IF(l_t,v1,v2), l_t </math>is the logical test or expression to evaluate.
 +
*<math> v1 </math> is  any value or the string and it is displays when the specified <math> l_t </math> is TRUE. 
 +
*<math> v2 </math>  is  any value or the string and it is displays when the specified l_t is FALSE.
 +
*For e.g.,IF(A2>1000,"costly","cheap").Here A2>1000 is the logical expression.costly is the v1 value and cheap is the v2 value.
 +
*When our mentioned amount is satifying the l_t then it shows "costly". Suppose our amount is not satifying the l_t it shows "cheap".
 +
*In CALCI we can give any number of IF functions can be nested as v1 and v2 statements to give for a complicated tests.
 +
*When v1 and v2 are calculated, IF returns the value returned by v1 or v2. 
 +
*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.
  
</div></div>
+
==Examples==
----
+
1.Number=20
<div id="2SpaceContent" align="left"><div class="ZEditBox" align="justify">
+
IF(A2>=0,"positive","negative") =positive
 +
Number=-18
 +
IF(A2>=0,"positive","negative")=negative
  
Examples-1
+
2.A1= IF(ISBLANK(A1)=TRUE,"BLANK",IF(ISTEXT(A1)=TRUE,"TEXT",IF(ISNUMBER(A1)=TRUE,"NUM","")))= BLANK
  
</div></div>
+
3. A1= winter
----
+
IF(ISBLANK(A1)=TRUE,"BLANK",IF(ISTEXT(A1)=TRUE,"TEXT",IF(ISNUMBER(A1)=TRUE,"NUM",""))) = TEXT
<div id="8SpaceContent" align="left"><div class="ZEditBox" align="justify">'''<font face="Times New Roman">''''''''''''<font size="6"> </font>''' '''''''''</font>'''</div></div>
 
----
 
<div id="11SpaceContent" align="left"><div class="ZEditBox mceEditable" align="justify">
 
  
<font size="5">Description</font>
+
4. A1=10000
 +
IF(ISBLANK(A1)=TRUE,"BLANK",IF(ISTEXT(A1)=TRUE,"TEXT",IF(ISNUMBER(A1)=TRUE,"NUM","")))=NUM
  
</div></div>
+
5.C1=40,D1=90
----
+
IF(C1<D1,C1+D1,C1-D1) = 130
<div id="5SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify"> 
 
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">IF is used to conduct conditional tests on values and formulas.</font></font></font>
 
  
</div></div>
+
==See Also==
----
 
<div id="10SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify"><font size="6">IF</font></div></div>
 
----
 
<div id="6SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify"> 
 
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">'''IF'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">('''L'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''og Test'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">,</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''V If true'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">,'''v If false''')</font></font></font>
+
==References==
 
 
<font color="#484848"><font face="Arial, sans-serif"><font size="2">'''where Log Test'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">   is any value or expression that can be evaluated to TRUE or FALSE and '''V''' </font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''If true'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">   is the value that is returned if logical_test is TRUE and '''V''' </font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''If false'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">   is the value that is returned if logical_test is FALSE.</font></font></font>
 
 
 
</div></div>
 
----
 
<div id="1SpaceContent" class="zcontent" align="left">
 
 
 
{| id="TABLE3" class="SpreadSheet blue"
 
|- class="even"
 
| class=" " |
 
| Column1
 
| Column2
 
| Column3
 
| Column4
 
|- class="odd"
 
| class=" " | Row1
 
| class="sshl_f " | 8
 
| class="sshl_f" | Alkaline
 
| class="                                                  " |
 
|
 
|- class="even"
 
| class="  " | Row2
 
| class="                                                                                                                    " |
 
|
 
| class="SelectTD" |
 
|
 
|- class="odd"
 
| Row3
 
|
 
|
 
|
 
|
 
|- class="even"
 
| Row4
 
|
 
|
 
|
 
|
 
|- class="odd"
 
| class=" " | Row5
 
|
 
|
 
|
 
|
 
|- class="even"
 
| Row6
 
|
 
|
 
|
 
|
 
|}
 
 
 
<div align="left">[[Image:calci1.gif]]</div></div>
 
----
 
<div id="7SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">
 
 
 
Examples-2
 
 
 
</div></div>
 
----
 
<div id="13SpaceContent" class="zcontent" align="left">
 
 
 
{| id="TABLE5" class="SpreadSheet blue"
 
|- class="even"
 
| class=" " |
 
| Column1
 
| Column2
 
| Column3
 
| Column4
 
|- class="odd"
 
| class=" " | Row1
 
| class="sshl_f  " | 40
 
| class="sshl_f" | P
 
| class="              " |
 
| class=" " |
 
|- class="even"
 
| class="  " | Row2
 
| class="sshl_f  " | 85
 
| class="sshl_f" | A
 
| class="  " |
 
| class=" " |
 
|- class="odd"
 
| Row3
 
| class="sshl_f" | 66
 
| class="                        sshl_f  " |
 
| class=" sshl_f" |
 
| class=" sshl_f" |
 
|- class="even"
 
| Row4
 
| class="  sshl_f  " |
 
<div id="13Space_Copy" title="Click and Drag over to AutoFill other cells."></div>
 
| class="  " |
 
| class=" " |
 
| class="SelectTD  sshl_t  SelectTD" |
 
<div id="13Space_Handle" title="Click and Drag to resize CALCI Column/Row/Cell. It is EZ!"></div><div id="13Space_Copy" title="Click and Drag over to AutoFill other cells."></div>
 
|- class="odd"
 
| class=" " | Row5
 
| class="                                                                            sshl_f  " |
 
| class=" " |
 
| class=" " |
 
| class=" " |
 
|- class="even"
 
| Row6
 
| class="  " |
 
| class=" " |
 
| class=" " |
 
| class=" " |
 
|}
 
 
 
<div align="left">[[Image:calci1.gif]]</div></div>
 
----
 
<div id="14SpaceContent" class="zcontent" align="left">
 
 
 
{| id="TABLE8" class="SpreadSheet blue"
 
|- class="even"
 
| class=" " |
 
| Column1
 
| Column2
 
| Column3
 
| Column4
 
|- class="odd"
 
| class=" " | Row1
 
| class="sshl_f " | 1000
 
| class=" " | 1500
 
| class="sshl_f" | Negative
 
| class="  sshl_f  " |
 
|- class="even"
 
| class="  " | Row2
 
| class="sshl_f" | 900
 
| class="sshl_f" | 900
 
| class="                            " |
 
| class="SelectTD" |
 
|- class="odd"
 
| Row3
 
| class="sshl_f" | 650
 
| class="sshl_f" | 1000
 
|
 
|
 
|- class="even"
 
| Row4
 
| class="                                                                                                                      " |
 
|
 
|
 
|
 
|- class="odd"
 
| class=" " | Row5
 
|
 
|
 
|
 
|
 
|- class="even"
 
| Row6
 
|
 
|
 
|
 
|
 
|}
 
 
 
<div align="left">[[Image:calci1.gif]]</div></div>
 
----
 
<div id="4SpaceContent" class="zcontent" align="left">  <font color="#484848"><font face="Arial, sans-serif"><font size="2">Let's see an example in Column1Row1</font></font></font>
 
 
 
<font color="#484848"><font face="Arial, sans-serif"><font size="2">B1 = 8</font></font></font>
 
 
 
<font color="#484848"><font face="Arial, sans-serif"><font size="2">I.e.=IF(B1&lt;7,”Acid”,”Alkaline”) is Alkaline</font></font></font>
 
 
 
</div>
 
----
 
<div id="9SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">
 
 
 
Examples-3
 
 
 
</div></div>
 
----
 
<div id="12SpaceContent" class="zcontent" align="left">  <font color="#484848"><font face="Arial, sans-serif"><font size="2">Assets Liabilities</font></font></font>
 
 
 
<font color="#484848"><font face="Arial, sans-serif"><font size="2">B1= 1000 C1 =1500</font></font></font>
 
 
 
<font color="#484848"><font face="Arial, sans-serif"><font size="2">B2 =900 C2=900</font></font></font>
 
 
 
<font color="#484848"><font face="Arial, sans-serif"><font size="2">B3 = 650 C3 = 1000</font></font></font>
 
 
 
<font color="#484848"><font face="Arial, sans-serif"><font size="2">I.e = IF(B1&lt;C2,”negative equity”,”plus”) is negative equity</font></font></font>
 
 
 
</div>
 
----
 
<div id="15SpaceContent" class="zcontent" align="left"> 
 
 
 
<font color="#484848"><font face="Arial, sans-serif"><font size="2">B1 = 40</font></font></font>
 
 
 
<font color="#484848"><font face="Arial, sans-serif"><font size="2">B2 = 85</font></font></font>
 
 
 
<font color="#484848"><font face="Arial, sans-serif"><font size="2">B3 =66</font></font></font>
 
 
 
<font color="#484848"><font face="Arial, sans-serif"><font size="2">I.e =IF(B1&gt;80,”A”,IF(B1&gt;60,”B”,IF(B1&gt;30,”P”))) is P</font></font></font>
 
 
 
<font color="#484848"><font face="Arial, sans-serif"><font size="2">///rly =IF(B2&gt;80,”A”,IF(B2&gt;60,”B”,IF(B2&gt;30,”P”))) is A</font></font></font>
 
 
 
</div>
 
----
 

Revision as of 03:16, 9 January 2014

IF(l_t,v1,v2)


  • is the logical test.
  • and 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.
  • is the Conditional statement and it is used to perform different actions based on different conditions.
  • In is the logical test or expression to evaluate.
  • is any value or the string and it is displays when the specified is TRUE.
  • is any value or the string and it is displays when the specified l_t is FALSE.
  • For e.g.,IF(A2>1000,"costly","cheap").Here A2>1000 is the logical expression.costly is the v1 value and cheap is the v2 value.
  • When our mentioned amount is satifying the l_t then it shows "costly". Suppose our amount is not satifying the l_t it shows "cheap".
  • In CALCI we can give any number of IF functions can be nested as v1 and v2 statements to give for a complicated tests.
  • When v1 and v2 are calculated, IF returns the value returned by v1 or v2.
  • 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.

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


See Also

References