The challenge this week is as follows: given a non-contiguous range, made up of an arbitrary number of single-column ranges, the values in each of which being either a numeric, text or null string, to generate a list, in numerical order and beginning in A2, of all numbers which occur precisely once within that range.

For example, in the below:

three numbers – 1, 2 and 9 – occur precisely once across the non-contiguous, union range defined by:

=C2:C7,E2:E4,E6:E9,G3:G11,J1:J9,L5:L6,N3:N7,N9:N10,N12

(You can download the file here.)

As usual, the formula in A2, when copied down, is to produce a blank in cells beyond the expected number of returns. What’s more, this is to be done via reference to another formula in A1, also to be derived, and whose value is equal to that expected number of returns. In this example that value is 3.

As such, the formula in A2 is to begin with:

IF(ROWS($1:1)>$A$1,"",

Also note that, even though the other cells in the range C1:N12 are empty in this example, this cannot be assumed to always be the case. In fact, solvers should assume that there may be numericals within those other cells as well.

Solution next week. Best of luck!

### Like this:

Like Loading...

*Related*

For A1:

A2 and copy down:

Or

A1:

A2:

Maybe I misunderstood your requirements?

Regards

Apologies – my fault for not being so clear.

Your second solution is not viable, as I should’ve mentioned that the other cells in C1:N12 could contain numericals which are not to be returned (otherwise it would kind of defeat the point of the non-contiguous range bit, wouldn’t it!).

And I completely forgot to mention that the returns should be in numerical order.

I will add both to the thread now.

Also, you may want to store that union range as a Defined Name?

But no, in general I don’t think you have misunderstood my requirements.

named range ‘Range_NC’ is

then count is

Very good, Cyril, and precisely what I used, though of course there are several alternatives available, such as the SUMPRODUCT version used by Bill, which is also perfectly good (although the ROW(1:10) construction is perhaps a touch “static”).

That’s the count. What about the main formula?

Hi XOR LX!

Create a Defined Name RNG with the data.

For the count:

And the Extract Formula in A2 (Confirm CSE):

Another Option Can be (without CSE):

¡Blessings!

Good to see you again, John!

And I can’t fault that solution whatsoever. Great stuff and well done!

(Nice of you to throw in a non-array version as well. I always wonder at which point over the next few years we’re going to start assuming as default that the majority of users have Excel 2010, and so we can start including the under-employed AGGREGATE in more of our solutions.)

Thanks a lot.

Nothing much to add.

use Named range Val_cnt described numerous times in your other challenges:

And in A2, CSE:

PS: Using Excel for MAC so NOT everyone is using Excel 2010… 🙂

Now what interested me was to return as well the text part AND the integers but in ascending order.

Great stuff, Cyril. A slightly different approach towards constructing the

bins_array, but equally good.This demonstrates the flexibility we have here with regards to this parameter. Although in this particular case we don’t actually

needto define it so precisely (In fact, Bill’s ROW(1:10)-1 will work just fine, although we should probably put an INDIRECT in to make it immune to row insertions), it’s nevertheless good practice to do so, as we may find ourselves in situations where such rigour is in fact required.Sorry – I should’ve subtitled this site

(Non-Mac) Advanced Excel Techniques…🙂Interesting other query as well. What “order” exists for numerics and text, though? Is “a” before 1?

1- “Non -MAC”… Alas I shall remain a lone macexceler… hehehe

2- Maybe text first then integers although the other way around is not an issue…

so either:

y

x

w

s

m

l

e

d

9

2

1

or

1

2

9

d

e

l

m

s

w

x

y

Now, thinking of it, maybe the second would make more sense?