PC Review


Reply
Thread Tools Rate Thread

How does Excel evaluate embedded "IF" statements

 
 
Kc-Mass
Guest
Posts: n/a
 
      6th Jan 2007
I am working on a large worksheet (50 meg, 13,000 rows) not of my making.

It has a huge number of embedded IF statements with VLOOKUPS also
embedded in them.

Each file is set to calculate manually after large segments of data are
pulled out
and replaced. the calculation can take over an hour.

Question: How does excel evaluate embedded IFs. If the first value is true,
does Excel take that value and stop or does it evaluate all the IFs in the
formula regardless of whether the first one is true?

I would say that in Formula "A" the likelyhood of the first IF condition
evaluating to true is less than thirty percent. The likelyhood of the
second IF condition evaluating to true is less than twenty percent. The
likelyhood of the third IF condition evaluating to true is more than sixty
percent.

Would rearranging the order of the formula components make calculation
faster.

Thx for any help/ideas


 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      6th Jan 2007
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


"Kc-Mass" wrote:

> I am working on a large worksheet (50 meg, 13,000 rows) not of my making.
>
> It has a huge number of embedded IF statements with VLOOKUPS also
> embedded in them.
>
> Each file is set to calculate manually after large segments of data are
> pulled out
> and replaced. the calculation can take over an hour.
>
> Question: How does excel evaluate embedded IFs. If the first value is true,
> does Excel take that value and stop or does it evaluate all the IFs in the
> formula regardless of whether the first one is true?
>
> I would say that in Formula "A" the likelyhood of the first IF condition
> evaluating to true is less than thirty percent. The likelyhood of the
> second IF condition evaluating to true is less than twenty percent. The
> likelyhood of the third IF condition evaluating to true is more than sixty
> percent.
>
> Would rearranging the order of the formula components make calculation
> faster.
>
> Thx for any help/ideas
>
>
>

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      6th Jan 2007
All your questions are answered here together with a lot more info you may
find useful

http://www.decisionmodels.com/

Regards,
Peter T

"Kc-Mass" <connearney_AT_comcast_PERIOD_net> wrote in message
news:(E-Mail Removed)...
> I am working on a large worksheet (50 meg, 13,000 rows) not of my making.
>
> It has a huge number of embedded IF statements with VLOOKUPS also
> embedded in them.
>
> Each file is set to calculate manually after large segments of data are
> pulled out
> and replaced. the calculation can take over an hour.
>
> Question: How does excel evaluate embedded IFs. If the first value is

true,
> does Excel take that value and stop or does it evaluate all the IFs in the
> formula regardless of whether the first one is true?
>
> I would say that in Formula "A" the likelyhood of the first IF condition
> evaluating to true is less than thirty percent. The likelyhood of the
> second IF condition evaluating to true is less than twenty percent. The
> likelyhood of the third IF condition evaluating to true is more than sixty
> percent.
>
> Would rearranging the order of the formula components make calculation
> faster.
>
> Thx for any help/ideas
>
>



 
Reply With Quote
 
Charles Williams
Guest
Posts: n/a
 
      6th Jan 2007
Embedded IFs are evaluated left-to-right, outermost ( ) to innermost ()
Evaluation does not continue after the first TRUE.

for suggestions on how to speed-up lookups see
http://www.decisionmodels.com/optspeede.htm

regards
Charles
______________________
Decision Models
FastExcel 2.3 now available
Name Manager 4.0 now available
www.DecisionModels.com

"Kc-Mass" <connearney_AT_comcast_PERIOD_net> wrote in message
news:(E-Mail Removed)...
>I am working on a large worksheet (50 meg, 13,000 rows) not of my making.
>
> It has a huge number of embedded IF statements with VLOOKUPS also
> embedded in them.
>
> Each file is set to calculate manually after large segments of data are
> pulled out
> and replaced. the calculation can take over an hour.
>
> Question: How does excel evaluate embedded IFs. If the first value is
> true, does Excel take that value and stop or does it evaluate all the IFs
> in the formula regardless of whether the first one is true?
>
> I would say that in Formula "A" the likelyhood of the first IF condition
> evaluating to true is less than thirty percent. The likelyhood of the
> second IF condition evaluating to true is less than twenty percent. The
> likelyhood of the third IF condition evaluating to true is more than sixty
> percent.
>
> Would rearranging the order of the formula components make calculation
> faster.
>
> Thx for any help/ideas
>
>



 
Reply With Quote
 
Kc-Mass
Guest
Posts: n/a
 
      6th Jan 2007
Many Thanks to all of you.

Great Info!


"Charles Williams" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Embedded IFs are evaluated left-to-right, outermost ( ) to innermost ()
> Evaluation does not continue after the first TRUE.
>
> for suggestions on how to speed-up lookups see
> http://www.decisionmodels.com/optspeede.htm
>
> regards
> Charles
> ______________________
> Decision Models
> FastExcel 2.3 now available
> Name Manager 4.0 now available
> www.DecisionModels.com
>
> "Kc-Mass" <connearney_AT_comcast_PERIOD_net> wrote in message
> news:(E-Mail Removed)...
>>I am working on a large worksheet (50 meg, 13,000 rows) not of my making.
>>
>> It has a huge number of embedded IF statements with VLOOKUPS also
>> embedded in them.
>>
>> Each file is set to calculate manually after large segments of data are
>> pulled out
>> and replaced. the calculation can take over an hour.
>>
>> Question: How does excel evaluate embedded IFs. If the first value is
>> true, does Excel take that value and stop or does it evaluate all the IFs
>> in the formula regardless of whether the first one is true?
>>
>> I would say that in Formula "A" the likelyhood of the first IF condition
>> evaluating to true is less than thirty percent. The likelyhood of the
>> second IF condition evaluating to true is less than twenty percent. The
>> likelyhood of the third IF condition evaluating to true is more than
>> sixty percent.
>>
>> Would rearranging the order of the formula components make calculation
>> faster.
>>
>> Thx for any help/ideas
>>
>>

>
>



 
Reply With Quote
 
John Coleman
Guest
Posts: n/a
 
      6th Jan 2007
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can the Excel cell fill color be changed using "IF" statements? JHG Microsoft Excel Worksheet Functions 1 8th May 2009 10:13 AM
Can Excel's field fill colors be changed using "IF" statements? JHG Microsoft Excel Worksheet Functions 2 7th May 2009 10:47 PM
how to evaluate approx "birthday" knowing "age" and current date fred75 Microsoft Access 7 4th Apr 2009 01:48 AM
In VS2008 need to to change some statements that contain " class=" to " cssclass=" AAaron123 Microsoft VB .NET 2 4th Apr 2009 12:24 AM
Need more than 7 nested "IF" statements in Excel" =?Utf-8?B?SmFtZXMgQQ==?= Microsoft Excel Misc 1 17th Dec 2006 02:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:01 AM.