Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Stephen A. Gye
 
Posts: n/a
Default Concatenate Four Columns With Seperators

Hi,

I have a spreadsheet with four columns, each of which may or may not have
data in them, that I would like to combine into one single string. Each
column that has data in it needs to be seperated by a "-". The possible
scenarios that I can think of are listed.

DRG_LINE1 - DRG_LINE2 - DRG_LINE3 - DRG_LINE4
DRG_LINE1 - DRG_LINE2 - DRG_LINE3
DRG_LINE1 - DRG_LINE3 - DRG_LINE4
DRG_LINE1 - DRG_LINE2 - DRG_LINE4
DRG_LINE1 - DRG_LINE2
DRG_LINE1 - DRG_LINE3
DRG_LINE1 - DRG_LINE4

DRG_LINE2 - DRG_LINE3 - DRG_LINE4
DRG_LINE2 - DRG_LINE3
DRG_LINE3 - DRG_LINE4
DRG_LINE2 - DRG_LINE4
DRG_LINE2
DRG_LINE3
DRG_LINE4

NOTHING AT ALL


I assume that I can do this some with some ID, AND and CONCATENATE
functions, but was ondering if someone had already done something like this
that they would be willing to share?

Thanks,
Steve


  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Concatenate Four Columns With Seperators

=A1&IF(B1<""," _ "&B1,"")&IF(C1<""," _ "&C1,"")&IF(D1<""," _ "&D1,"")

--
HTH

Bob Phillips

(replace somewhere in email address with googlemail if mailing direct)

"Stephen A. Gye" wrote in message
...
Hi,

I have a spreadsheet with four columns, each of which may or may not have
data in them, that I would like to combine into one single string. Each
column that has data in it needs to be seperated by a "-". The possible
scenarios that I can think of are listed.

DRG_LINE1 - DRG_LINE2 - DRG_LINE3 - DRG_LINE4
DRG_LINE1 - DRG_LINE2 - DRG_LINE3
DRG_LINE1 - DRG_LINE3 - DRG_LINE4
DRG_LINE1 - DRG_LINE2 - DRG_LINE4
DRG_LINE1 - DRG_LINE2
DRG_LINE1 - DRG_LINE3
DRG_LINE1 - DRG_LINE4

DRG_LINE2 - DRG_LINE3 - DRG_LINE4
DRG_LINE2 - DRG_LINE3
DRG_LINE3 - DRG_LINE4
DRG_LINE2 - DRG_LINE4
DRG_LINE2
DRG_LINE3
DRG_LINE4

NOTHING AT ALL


I assume that I can do this some with some ID, AND and CONCATENATE
functions, but was ondering if someone had already done something like

this
that they would be willing to share?

Thanks,
Steve




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
Help with grouping columns couriced New Users to Excel 5 September 2nd 05 05:07 PM
How do I concatenate two columns when one is in date format? LauraL Excel Discussion (Misc queries) 3 August 29th 05 04:07 PM
Removing Near-Duplicate Rows, Leaving Those w/Most Data in Specific Columns foofoo Excel Discussion (Misc queries) 1 April 2nd 05 12:02 AM
Help with a formula for concatenate and search/find with 3 columns Mel Excel Worksheet Functions 4 March 7th 05 09:12 PM
Counting the Contents of Two Columns Molochi Excel Discussion (Misc queries) 6 December 22nd 04 08:13 PM


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

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

About Us

"It's about Microsoft Excel"