ISBLANK vs LEN (most efficient)

eggyjla

Active Member
Joined
Dec 16, 2004
Messages
346
I have 10,000+ rows where one of the two forms is copied into A:A, C:C, E:E, G:G and I:I. I'm wondering which of the two is the preferred approach for keeping the recalculate time low. Which should take less time or less computing resources, or are would they be the same? I created two files, one withe each formula and the file size of both workbooks appear to be nearly the same.


Code:
=IF(ISBLANK(B1),"",VLOOKUP(B1,$M$1:$N$10,2,))

Code:
=IF(LEN(B1),VLOOKUP(B1,$M$1:$N$10,2,),"")
 
@shg - Looks as if for the same number of cells to be calculated, LEN(blank) has the fastest compute time at 2.1 s followed by ISBLANK(text) at 3.6 s. If I'm interpreting the table correctly, although ISBALNK is performing twice the number of calcs at a quicker rate, the overall compute time of LEN(blank) is faster? LEN(text) has the same number of iterations as the ISBLANK(), that's interesting! So if the cells contained a mixed set of values (blank, #, text), LEN would have the lowest (quickest) average compute time of 3.2 s compared to ISBLANK at 3.7 s where of course the majority of preferred values would favor either LEN(blank) or ISBLANK(text).
 
Last edited:
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
The code calculates each block of formulas 1, 2, 4, 8, ... times until the calculation of each group of formulas takes 2 seconds or more, just to get a level of precision with Timer. The Time column is irrelevant; it will always be between 2 and 4 seconds. What's relevant is Time/Calc, which is Time / (Cells * Iterations). Smaller is better.

That's summarized in the Speed column, which is time/calc for the fastest formula divided by time/calc for this formula. In this column, just like a speedometer, bigger means faster. By that calculation, the SLOWEST formula always has a speed of 1.0.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,306
Members
452,633
Latest member
DougMo

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