Trouble with nested IF formula

  • Thread starter Thread starter TheRobsterUK
  • Start date Start date
T

TheRobsterUK

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top