Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
TheRobsterUK
 
Posts: n/a
Default 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


--
TheRobsterUK


------------------------------------------------------------------------
TheRobsterUK's Profile: http://www.excelforum.com/member.php...fo&userid=9924
View this thread: http://www.excelforum.com/showthread...hreadid=473216

  #2   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Think of it in these terms:

=IF(D20=0 *and* IF(rand<prob1,average+(0.5-RAND())*var,0), *or* IF
.........................))

Biff

"TheRobsterUK"
wrote in message
news:TheRobsterUK.1wejyc_1128470720.8979@excelforu m-nospam.com...

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


--
TheRobsterUK


------------------------------------------------------------------------
TheRobsterUK's Profile:
http://www.excelforum.com/member.php...fo&userid=9924
View this thread: http://www.excelforum.com/showthread...hreadid=473216



Reply
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
Referencing lists in a nested IF formula JTinAtlanta Excel Worksheet Functions 1 July 30th 05 12:00 AM
Nested Formula TheLeafs Excel Worksheet Functions 1 July 11th 05 04:04 PM
Trouble with Syntax - IF formula Bert via OfficeKB.com New Users to Excel 1 April 8th 05 01:00 AM
Relative Indirect Formula Referencing? Damian Excel Worksheet Functions 1 January 7th 05 04:16 AM
Nested Formula Jeannette Excel Worksheet Functions 3 November 17th 04 07:04 PM


All times are GMT +1. The time now is 07:23 AM.

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"