Results 1 to 2 of 2

Trouble with nested IF formula

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-26-2004
    Location
    Halifax, UK
    MS-Off Ver
    Office 365 v2402
    Posts
    263

    Trouble with nested IF formula

    I'm trying to decipher someone else's spreadsheet and have come across the following worksheet formula:

    =IF(D20=0,IF(rand<prob1,average+(0.5-RAND())*var,0),IF(rand<prob2,average+(1-RAND())*var,0))

    It's the first part I am having a problem with. I always thought that the syntax for nested IF functions was along the lines of:

    IF conditon is True THEN do this, ELSEIF the next condition is True THEN do this, ELSEIF the next condition is True THEN do this..............ELSE do this.

    But this doesn't seem to be the way the above formula works. It has the first part: IF condition is True.....but then it goes straight into the next IF statement.

    I.e. IF(D20=0, IF(rand.....

    But I would have thought it should say: IF(D20=0, *do this*, IF(rand...

    Can anyone explain what the formula is actually doing?

    Thanks
    -Rob
    Last edited by TheRobsterUK; 10-04-2005 at 07:44 PM.

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