View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions,microsoft.public.excel
Ashish Mathur[_2_] Ashish Mathur[_2_] is offline
external usenet poster
 
Posts: 1,766
Default Copying rows down into cells across until row=false ?

Hi,

Download and install the following addin from here -
http://www.download.com/Morefunc/300...-10423159.html. Suppose the
data is in A1:A8. In A9, enter any capital letter, say A. In A12:A15,
enter COW, SHEEP, RHINO and A. In cell B12, array enter the following
formula (Ctrl+Shift+Enter) and copy down till cell B14

=IF(MATCH(A12,$A$1:$A$9,0)-MATCH(A13,$A$1:$A$9,0)=-1,"",MCONCAT(INDIRECT(ADDRESS(MATCH(A12,$A$1:$A$9, 0)+1,1)&":"&ADDRESS(MATCH(A13,$A$1:$A$9,0)-1,1)),","))

Hope this helps.
--
Regards,

Ashish Mathur
Microsoft Excel MVP

"jonski" wrote in message
...
Sorry about the title, let me explain in more detail:

In row A, I have various listings. The title is always in caps, the user
is
always in mixed case.

For example:

COW
SHEEP
Jim
Bob
Stu
RHINO
Dave
Ollie

So, no-one is interested in COWS but Jim, Bob and Stu like SHEEP. And what
I
need to end up with is:

COW
SHEEP | Jim, Bob and Stu
RHINO | Dave and Ollie

You get the picture. It doesn't matter if the readers names go into one
cell
each, I can concatenate them later.

Now, what I've worked out is that I can put a TRUE or a FALSE in the next
column along, with:
=IF(AND(LEN(A1)1,EXACT(A1, UPPER(A1))),TRUE,FALSE)

So I've got

Code:
COW | TRUE
SHEEP | TRUE
Jim | FALSE
Bob | FALSE
Now, what I HAD planned on doing was a formula which would test if the
cell
to the right of A1 said true or false, then concatenate the contents of
the
cell below the contents of A1 in the most recent TRUE cell, then
concatenate
that plus the next on and the next one until we get another TRUE. But of
course, the cell value changes too.

So I'm clearly out of my depth here! I just showed that to prove that I
have
at least tried and thought about it,