The challenge this week is as follows: a single formula to return an array which consists of all entries (of potentially mixed datatype) from a given range in multiple worksheets.

No restrictions are placed on the dimensions of the returned array.

For example, using the attached file (download here), the formula should return an array such as:

{18,"",19,63,"","",67;"",46,"","","L","",7;"N","Z","","F",70,19,"";"","","","","","",73;"","","T","","",88,"Y";"U","","B","F","Q",71,"";"","H","U","R",86,84,"Q";11,"R",84,"","",43,72;39,53,"","","R",60,80;"","V","B",33,"",46,39;"","B","","","V","","";"P","","M","","","",85;"O","",9,"","","","";"","I",9,"","S","S",59;"","X","J","","","","X";46,72,"",22,"",67,"P";35,32,69,"O","","","V";24,"","","","R","","";"",5,"B",69,"C","","";"P","A",19,"","","K","B"}

or a dimensional variation thereof.

For the sake of consistency, the specified range (A1:G4 in the attached example) should be referred to as the Defined Name *Rng* in any formulas. Likewise for any references which refer to a collection of worksheets, e.g.:

={"Sheet1","Sheet2","Sheet3","Sheet4","Sheet5"}

which should be given the Defined Name *Sheets*.

Also please note that this is **not** a *Shortest* Formula Challenge! Hence rigour should be preferred over brevity in any solution.

Solution next week. Good luck!

### Like this:

Like Loading...

*Related*

Great challenge!

Here goes:

The “evaluate formula” may show errors but it will return the correct results if wrapped around SUM or COUNTA as examples.

On second thought my formula won’t work with any column number ending in zero (e.g. column 10). Here’s another shot at it:

i like Alex’s approach, but think it might need wrapping in IF(1,CELL(“contents”,…)) for it to work inside functions like COUNT and MEDIAN and also to be able to array enter over a range of cells.

A 2013 variation that i believe will also work in different language versions is:

Wow lori, that is fantastic! It never occurred to me that any cell reference could be identified numerically using base 36. This opens up a ton of possibilities!

-Alex

Also of note, this DECIMAL technique will work for all rows up to column ZZ, or for all columns up to row 999,999.

For AAA1000000 to XFD1048576, Excel’s precision isn’t high enough. Still, a very good working domain overall!

-Alex

alex – according to MS help on the DECIMAL function it supports all numbers up to 2^53 (which is consistent with the standard floating point double representation). Since this is greater than 36^10 this should support any cell reference up to ten digits including XFD1048756 I believe but I haven’t had a chance conclusively test this.

Adapting lori’s formula to a pre-2013 solution:

This should return identical results to the solution using DECIMAL.

You’re right (as always!) lori, I was fooled because for example the formula

Shows a result in the cell of 3394816136683600, and I misinterpreted the rounding of the visible result to mean that Excel was losing precision. But having then translated that result back into base 36, I can confirm it returned the correct answer.

Yeah, applying BASE(…,10) to the formula result shows it actually ends in “02”. This display rounding can be a source of much confusion for users, for example entering 1 in A1 and =1+1E-15 in B1 we see that both return the same display result, also putting =A1-B1 in C1 returns zero, it is only by placing parentheses around the formula =(A1-B1) that we can see the underlying numbers are different.

And perhaps it might be worth adapting the pre-2013 formula to use OFFSET which i understand is a little more efficient:

(though still less readable!) Maybe xor lx had something like this in mind – we shall see…

Wow MichaelCH, that formula is tight! I think you still need to wrap it in CELL(“contents”,…) though for the reasons Lori outlined above. But outrageous nonetheless!

With CELL():

XOR LX, May we take some “liberties” with a rule. Specifically may

be defined as a column?

Dave

@Dave WentaI have no problems with that.

Regards

Lori, Alex, and/or Michael,

Assume each tab had an additional column whose values should serve as criteria for a count, sum, average, min, max, etc. Can you show how your formulas might be adapted to incorporate that logic?

I am thinking along the lines of the XOR LX post from Jan 8, 2016 — Incrementing Indirect Column References Within SUMIF(S)/COUNTIF(S) — but of course needing to account for this case involving the data range and criteria range being of different sizes.

Pingback: Advanced Formula Challenge #13: Results and Discussion « EXCELXOR

And, you can use these solutions in conjunction with the Excel 2016 TEXTJOIN function to make delimited strings (among other things)for multi-sheet ranges.

Pingback: Using the Excel TEXTJOIN Function To Return Unique Items In A One-Cell Delimited String From A 2D and 3D Range By David Hager | Excel For You

I borrowed ideas from this challenge and the result is the link to the article. Thanks for all y’alls help, especially XOR LX for this fabulous Excel site for Excel formulators.

https://www.linkedin.com/pulse/using-excel-textjoin-function-delimited-unique-string-david-hager?published=t