Colin Legg
MrExcel MVP
- Joined
- Feb 28, 2008
- Messages
- 3,507
- Office Version
- 365
- Platform
- Windows
Hi all,
I noted today that in the helpfile topic for the IF() worksheet function it is possible to omit both the function's 2nd and 3rd arguments.
Although to do so you have to add a comma after the logical_test, eg:
When both [value_if_true] and [value_if_false] arguments are omitted the function always returns 0 if the condition is met or FALSE() if the condition is not met (unless the condition references an error value in which case an error is returned).
Can anyone think of an instance where using the IF() function like this could be remotely useful?
Note - I'm comfortable with leaving one of these arguments out, just can't think of a valid application for leaving both out. Just a feeling in the back of my mind that the fact that IF() in this format is able to return different data types (number vs logical depending on condition=TRUE vs FALSE) might mean that there could be a clever use for it?
Cheers,
Syntax said:IF(logical_test, [value_if_true], [value_if_false])
I noted today that in the helpfile topic for the IF() worksheet function it is possible to omit both the function's 2nd and 3rd arguments.
Although to do so you have to add a comma after the logical_test, eg:
Code:
=IF(A1="hello",)
When both [value_if_true] and [value_if_false] arguments are omitted the function always returns 0 if the condition is met or FALSE() if the condition is not met (unless the condition references an error value in which case an error is returned).
Can anyone think of an instance where using the IF() function like this could be remotely useful?
Note - I'm comfortable with leaving one of these arguments out, just can't think of a valid application for leaving both out. Just a feeling in the back of my mind that the fact that IF() in this format is able to return different data types (number vs logical depending on condition=TRUE vs FALSE) might mean that there could be a clever use for it?
Cheers,