Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default Need help with Concatenate function

On Sun, 9 Jan 2011 00:52:56 -0800 (PST), Snowy wrote:

I have data in excel like below.
I want to concatenate 1 cell after every blank cell to there related
set of values.

For e.g:

0023.00 Brucellosis
0023.00 Brucella melitensis
0023.10 Brucella abortus
0023.20 Brucella suis
0023.30 Brucella canis
0023.80 Other brucellosis
0023.80 Infection by more than one organism
0023.90 Brucellosis, unspecified

Should Look like

0023.00 Brucellosis
0023.00 Brucellosis - Brucella melitensis
0023.10 Brucellosis - Brucella abortus
0023.20 Brucellosis - Brucella suis
0023.30 Brucellosis - Brucella canis
0023.80 Brucellosis - Other brucellosis
0023.80 Brucellosis - Infection by more than one organism
0023.90 Brucellosis - Brucellosis, unspecified

Eg 2.

0024.00 Glanders
0024.00 Infection by:
0024.00 Actinobacillus mallei
0024.00 Malleomyces mallei
0024.00 Pseudomonas mallei
0024.00 Farcy
0024.00 Malleus

It should look like

0024.00 Glanders
0024.00 Glanders - Infection by:
0024.00 Glanders - Actinobacillus mallei
0024.00 Glanders - Malleomyces mallei
0024.00 Glanders - Pseudomonas mallei
0024.00 Glanders - Farcy
0024.00 Glanders - Malleus


I have so many sets separating with the blank row.

Please help me on this.

Thanks
Snowy


I note that your sets, although separated by blank rows, are also characterized by the integer portion of the ID being the same. Ordinarily, I would "key" off that. But looking at your later clarification, it seems you really want to key off the blank entry.

Accordingly, assuming that B1 is blank, and your first entry is in B2,

C2: =IF(B2="","",IF(OFFSET(B2,-1,0)="",B2,LOOKUP(2,1/($B$1:B2=""),$B$2:B3)&" - " & B2))

and fill down as far as needed. The references will self adjust.

If you have to change the cell references, note that for the LOOKUP function, the lookup_vector and result_vector are offset by 1.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenate function NSNR[_2_] Excel Worksheet Functions 2 March 4th 10 04:16 PM
CONCATENATE FUNCTION tadwestie Excel Worksheet Functions 3 January 11th 10 07:42 PM
concatenate function help andresg1975 Excel Discussion (Misc queries) 2 October 19th 06 04:32 PM
Concatenate Function BenG Excel Discussion (Misc queries) 3 September 21st 06 10:08 PM
concatenate function Nospam Excel Programming 2 July 22nd 06 07:00 PM


All times are GMT +1. The time now is 06:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"