Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Concatenating non adjacent cells

Hello - I am trying to create a field that concatenates cells that are
populated from the previous 12 cells on that row, but excluding blanks and
adding a * delimited character between each instance. Please find a 4 column
example below

ID 1 2 3 4 Result required
Z A C D A*C*D
Y B C B*C
X A B D A*B*D

I will be applying this to a 2007 version spreadsheet containing in excess
of 10,000 lines. There will be at least 5 blank cells on each row.

Many thanks - Bob


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default Concatenating non adjacent cells

http://www.microsoft.com/office/comm...2c1&sloc=en-us


"Bob Freeman" wrote:

Hello - I am trying to create a field that concatenates cells that are
populated from the previous 12 cells on that row, but excluding blanks and
adding a * delimited character between each instance. Please find a 4 column
example below

ID 1 2 3 4 Result required
Z A C D A*C*D
Y B C B*C
X A B D A*B*D

I will be applying this to a 2007 version spreadsheet containing in excess
of 10,000 lines. There will be at least 5 blank cells on each row.

Many thanks - Bob


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 506
Default Concatenating non adjacent cells

Assume that you are having the example database from A1 to E4 range like the
below:-

COL A COL B COL C COL D COL E
ROW1 ID 1 2 3 4
ROW2 Z A BLANK C D
ROW3 Y BLANK B C BLANK
ROW4 X A B BLANK D

In cell F2 paste the below formula:

=SUBSTITUTE(SUBSTITUTE(CONCATENATE(TRIM(B2),"*",TR IM(C2),"*",TRIM(D2),"*",TRIM(E2)),"BLANK*",""),"*B LANK","")

Copy the F2 cell and paste it for the remaining cells of F Column.

Now the results will show like the below:-
A**C*D
*B*C*
A*B**D

Now place the cursor in B1 and select upto E4 that is the selection range
should be B1:E4. Press CNTRL+GSPECIALselect BLANKS Option Button and
press ok. Now you will see the blank cells will be getting selected (i.e.)
B3,C2, D4 & E3. Now press Cntrl+H which will open the find and replace
dialog box. In FIND WHAT: field leave it as blank and in REPLACE WITH: field
type BLANK and give REPLACE ALL and click close.

Now you can notice that the cell F2 to F4 will show the desired results.
Copy and paste the F Column formula to values.

Now select B1:E4 again press Cntrl+H which will open the find and replace
dialog box. In FIND WHAT: type BLANK and in REPLACE WITH: field leave it as
blank and give REPLACE ALL and click close, which will restore the cell which
is having the character BLANK from B1:E4 to blank cells.

Thats It!!!

Remember to Click Yes, if this post helps!

--------------------
(Ms-Exl-Learner)
--------------------


"Bob Freeman" wrote:

Hello - I am trying to create a field that concatenates cells that are
populated from the previous 12 cells on that row, but excluding blanks and
adding a * delimited character between each instance. Please find a 4 column
example below

ID 1 2 3 4 Result required
Z A C D A*C*D
Y B C B*C
X A B D A*B*D

I will be applying this to a 2007 version spreadsheet containing in excess
of 10,000 lines. There will be at least 5 blank cells on each row.

Many thanks - Bob


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
Concatenating adjacent cells ignoring blanks and adding a delimite Bob Freeman Excel Discussion (Misc queries) 3 January 27th 10 09:14 PM
Concatenating non adjacent cells Bob Freeman Excel Discussion (Misc queries) 2 January 27th 10 12:59 PM
Add cells on two adjacent rows but non-adjacent columns Eve Excel Worksheet Functions 14 October 20th 09 02:32 AM
Concatenating info from several cells into the one above method373 Excel Discussion (Misc queries) 1 February 22nd 06 01:18 AM
Concatenating Cells jbenet Excel Discussion (Misc queries) 5 December 10th 05 09:51 AM


All times are GMT +1. The time now is 05:04 AM.

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"