+ Reply to Thread
Results 1 to 3 of 3

Immediate If function (IIf). How it is interpreted?

  1. #1
    Registered User
    Join Date
    08-10-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    Excel 2007
    Posts
    22

    Immediate If function (IIf). How it is interpreted?

    Hi

    I've encountered a problem within the following block of code:

    Please Login or Register  to view this content.
    When this statement is executed, overflow error is being thrown. For me it looks like part 'Counter / Denominator' is 'precompiled' before condition is examined, so that error is raised first.

    This functionality seems to be a little bit illogical, as I want to check the condition first, and then take defined action, rather then checking all before examininng condition specified at the beginning of IIf function.

    Could someone explain to me, how interpreter processes this statement?

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Iif evaluates both expressions so it's not really suitable for what you want to do.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    08-10-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Immediate If function (IIf). How it is interpreted?

    Norie,

    thanks for explanation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1