Hi ,
Whenever a function is used in Excel , it may or may not have parameters ; one example of a function which does not expect parameters is the TODAY() or NOW() function , where you cannot have it as =TODAY(A1) or =NOW(A1).
At the same time , there are other functions which expect parameters ; even a simple function like the IF function has a maximum of 3 parameters where some parameter(s) will be mandatory , while others are optional. If you see the Excel help on any function , the optional parameters will be enclosed in square brackets [....]
What this means is that if you specify an optional parameter , Excel will take it into consideration ; if you do not specify an optional parameter , then Excel will take a default value for this ( or these ) parameter(s).
For example , suppose you use =IF(A1,,) this is a perfectly valid formula though it will not serve any purpose ! What it means is that Excel will check the value of A1 , and whether it is TRUE or FALSE will return the default value of 0.
You can even use =IF(,,) , which will also always return the value 0 ! You can go one step further , and use =IF(,) , which will always return the value FALSE.
However , you cannot use =IF() , since IF expects at least one parameter which is the condition to be checked ; what the commas in the formula =IF(,,) do is that they act as placeholders ; they tell Excel to take the default value for the parameters which are not specified ; since you have used two commas , Excel knows that you have used default values for all the three parameters viz.
the condition to be checked ,
the value if TRUE ,
the value if FALSE
The default value for the condition to be checked is FALSE , the default value for the value if FALSE is 0 , and so the formula returns 0.
If you use =IF(,) , then Excel knows that you have used only two parameters ; since the default value for the condition to be checked is FALSE , and you have not specified the third parameter , Excel returns FALSE , not 0.
If this explanation is very confusing , going through the Excel help for other functions , and trying them out with commas instead of the optional parameters will clear it up.
Narayan