2 Questions regarding Excel Efficiency

UniMord

Active Member
Joined
May 6, 2002
Messages
311
I have 2 questions regarding Excel efficiency.
  1. Do Excel's logical functions always evaluate every argument? Specifically, let's say I have a formula like this:
    Code:
    [B]=IF([COLOR=navy]AND([/COLOR][/B]A2>A1[B][COLOR=navy],[/COLOR][/B] VLOOKUP(B2, RANGE_IN_DIFFERENT_WORKBOOK, 7) > MIN(SOME_RANGE)[B][COLOR=navy],[/COLOR][/B] SOME_CRAZY_EXPENSIVE_VOLATILE_FORMULA[B][COLOR=navy])[/COLOR][/B], etc...[B])[/B]
    Normally, I'd just multiply the conditions, rather than invoke AND (just looks cooler :cool:), however, if AND evaluates from left to right, and quits after the first FALSE, then AND would be the much cheaper way to go.

  2. Is using a formula in an Advanced Filter any cheaper than just manually applying the formula to every row and then filtering? For example, I can add a column with a multi-conditioned formula that evaluates to TRUE/FALSE, then filter that column, or I can use that formula just once in Advanced Filter. Is this more efficient, or is Excel still applying the formula, under the hood, to every row, so nothing is gained?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
1. Yes. (try it with a UDF)
2. Depends what you mean by cheaper.
 
Upvote 0
If you use a sequential construct, Excel only evaluates as far as needed:

=if(cond1, if(cond2, answA, answB), answC)

cond2 only gets evaluated if cond1 is true.
 
Upvote 0
2. Depends what you mean by cheaper.

Rorya: Regarding the Advanced Filter, I'm talking cheaper in terms of calculation time, which, upon further consideration, it would seem to me (correct me if I'm wrong), that the Advanced Filter would be cheaper since it doesn't automatically recalculate, unlike formulas in a table column.
 
Upvote 0
Correct, though for the same reason it is probably more expensive at filter time. The single formula is also better in terms of file size.
 
Upvote 0

Forum statistics

Threads
1,224,594
Messages
6,179,795
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top