LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default How does Excel evaluate embedded "IF" statements

I wish VBA were like that.

As a worksheet function =IF(TRUE,1,1/0) returns an unproblematic 1 but
the VBA equivalent IIF(True,1,1/0) throws a divison by zero error. This
renders the IIF() function much less useful than it could be, which
might be one of the reasons that VBA programmers seem to not use it
much.

Gary''s Student wrote:
If TRUE, then only the first argument gets evaluated.
If FALSE, then the first argument gets skipped and the second argument gets
evaluated.
--
Gary's Student


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can the Excel cell fill color be changed using "IF" statements? JHG Excel Worksheet Functions 1 May 8th 09 10:13 AM
Evaluate "nested-merge" function? Mikael Lindqvist Excel Worksheet Functions 3 November 3rd 08 04:53 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Need more than 7 nested "IF" statements in Excel" James A Excel Discussion (Misc queries) 1 December 17th 06 02:02 AM
"Activeworkbook" function not valid when workbook embedded in Lotus Notes? Punsterr Excel Programming 0 May 10th 06 11:37 PM


All times are GMT +1. The time now is 07:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"