Array results and performance

Dave Bruns

New Member
Joined
May 4, 2014
Messages
10
Many formulas return an array result when given an array. For example, =ROW(range) returns an array of row numbers.

And this formula returns an array of cell addresses in a range:

=ADDRESS(ROW(range),COLUMN(range))

But when entered as a single cell formula, you may not realize you're getting back an array, since Excel happily displays just the first value.

My question: from a performance standpoint, does this matter?

In other words, is Excel smart enough to calculate only the first item in an array result when only one item is needed?

Or does Excel calculate all array results regardless?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Excel calculates all the array results.

It's interesting, though. If I define a very large named range called "data" with 10 million cells (1,000,000 rows x 10 columns), I don't notice any real delay if I use formulas like:

=ADDRESS(ROW(range),COLUMN(range))

Even though the "resultant array" is extremely large.

But if I ask for random item in the array with INDEX:

=INDEX(ADDRESS(ROW(data),COLUMN(data)),1000)

There is a significant delay before Excel returns the result. It could be that INDEX is to blame as it churns through the array, but it does seem that Excel is highly optimized for situations where a resultant array is being displayed in a single cell (i.e. only the first item in the array is displayed).
 
Upvote 0
Whoops, that first formula should have been:

=ADDRESS(ROW(data),COLUMN(data))

Where "data" is the giant named range.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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