Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Concatenate with gap suppression!

Hi,

I have a list of data in a column that are lookup answers from across
several sheets in excel 2000. the data looks something like this:

black
0
blue
0
0
0
green
0
red

(the zeros are returned from blank cells)

I want to be able to concatenate all the words with a line break between
each on but suppress the lines with a zero so my end cell looks like this:

black
blue
red
green

i can manage =concatenate(a1,char(10),a2,char(10),etc....)
but i cant think how to suppress the zeros and still get a line break after
each word.
Any help would be great thanks.
Brett
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Concatenate with gap suppression!

This will (almost*) do it for your 9 values in A1 to A9:

=IF(A1=0,"",A1)&IF(A2=0,"",CHAR(10)&A2)&IF(A3=0,"" ,CHAR(10)&A3)&IF(A4=0,"",CHAR(10)&A4)&IF(A5=0,"",C HAR(10)&A5)&IF(A6=0,"",CHAR(10)&A6)&IF(A7=0,"",CHA R(10)&A7)&IF(A8=0,"",CHAR(10)&A8)&IF(A9=0,"",CHAR( 10)&A9)

though I'm sure there must be a simpler way. You need to format the
cell to wrap text and you will get:

black
blue
red
green

as required.

*If instead of "black" you had a zero for the first entry, then you
will have one blank line above the rest of your values.

Hope this helps.

Pete

On Jul 25, 10:00 am, Bretter99
wrote:
Hi,

I have a list of data in a column that are lookup answers from across
several sheets in excel 2000. the data looks something like this:

black
0
blue
0
0
0
green
0
red

(the zeros are returned from blank cells)

I want to be able to concatenate all the words with a line break between
each on but suppress the lines with a zero so my end cell looks like this:

black
blue
red
green

i can manage =concatenate(a1,char(10),a2,char(10),etc....)
but i cant think how to suppress the zeros and still get a line break after
each word.
Any help would be great thanks.
Brett



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Concatenate with gap suppression!


try:

=SUBSTITUTE(CONCATENATE(A1,CHAR(10),A2,CHAR(10),A3 ),"0" & CHAR(10),"")

"Pete_UK" wrote:

This will (almost*) do it for your 9 values in A1 to A9:

=IF(A1=0,"",A1)&IF(A2=0,"",CHAR(10)&A2)&IF(A3=0,"" ,CHAR(10)&A3)&IF(A4=0,"",CHAR(10)&A4)&IF(A5=0,"",C HAR(10)&A5)&IF(A6=0,"",CHAR(10)&A6)&IF(A7=0,"",CHA R(10)&A7)&IF(A8=0,"",CHAR(10)&A8)&IF(A9=0,"",CHAR( 10)&A9)

though I'm sure there must be a simpler way. You need to format the
cell to wrap text and you will get:

black
blue
red
green

as required.

*If instead of "black" you had a zero for the first entry, then you
will have one blank line above the rest of your values.

Hope this helps.

Pete

On Jul 25, 10:00 am, Bretter99
wrote:
Hi,

I have a list of data in a column that are lookup answers from across
several sheets in excel 2000. the data looks something like this:

black
0
blue
0
0
0
green
0
red

(the zeros are returned from blank cells)

I want to be able to concatenate all the words with a line break between
each on but suppress the lines with a zero so my end cell looks like this:

black
blue
red
green

i can manage =concatenate(a1,char(10),a2,char(10),etc....)
but i cant think how to suppress the zeros and still get a line break after
each word.
Any help would be great thanks.
Brett




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Concatenate with gap suppression!

Thanks Toppers, awesome mate, I been trying to do this for years, lol :P
Thanks Pete_UK same result, just more typing :(,
Brett

"Toppers" wrote:


try:

=SUBSTITUTE(CONCATENATE(A1,CHAR(10),A2,CHAR(10),A3 ),"0" & CHAR(10),"")

"Pete_UK" wrote:

This will (almost*) do it for your 9 values in A1 to A9:

=IF(A1=0,"",A1)&IF(A2=0,"",CHAR(10)&A2)&IF(A3=0,"" ,CHAR(10)&A3)&IF(A4=0,"",CHAR(10)&A4)&IF(A5=0,"",C HAR(10)&A5)&IF(A6=0,"",CHAR(10)&A6)&IF(A7=0,"",CHA R(10)&A7)&IF(A8=0,"",CHAR(10)&A8)&IF(A9=0,"",CHAR( 10)&A9)

though I'm sure there must be a simpler way. You need to format the
cell to wrap text and you will get:

black
blue
red
green

as required.

*If instead of "black" you had a zero for the first entry, then you
will have one blank line above the rest of your values.

Hope this helps.

Pete

On Jul 25, 10:00 am, Bretter99
wrote:
Hi,

I have a list of data in a column that are lookup answers from across
several sheets in excel 2000. the data looks something like this:

black
0
blue
0
0
0
green
0
red

(the zeros are returned from blank cells)

I want to be able to concatenate all the words with a line break between
each on but suppress the lines with a zero so my end cell looks like this:

black
blue
red
green

i can manage =concatenate(a1,char(10),a2,char(10),etc....)
but i cant think how to suppress the zeros and still get a line break after
each word.
Any help would be great thanks.
Brett




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Concatenate with gap suppression!

Guys,

Is there any way that i can also get this to skip duplicates?

Thanks

"Bretter99" wrote:

Thanks Toppers, awesome mate, I been trying to do this for years, lol :P
Thanks Pete_UK same result, just more typing :(,
Brett

"Toppers" wrote:


try:

=SUBSTITUTE(CONCATENATE(A1,CHAR(10),A2,CHAR(10),A3 ),"0" & CHAR(10),"")

"Pete_UK" wrote:

This will (almost*) do it for your 9 values in A1 to A9:

=IF(A1=0,"",A1)&IF(A2=0,"",CHAR(10)&A2)&IF(A3=0,"" ,CHAR(10)&A3)&IF(A4=0,"",CHAR(10)&A4)&IF(A5=0,"",C HAR(10)&A5)&IF(A6=0,"",CHAR(10)&A6)&IF(A7=0,"",CHA R(10)&A7)&IF(A8=0,"",CHAR(10)&A8)&IF(A9=0,"",CHAR( 10)&A9)

though I'm sure there must be a simpler way. You need to format the
cell to wrap text and you will get:

black
blue
red
green

as required.

*If instead of "black" you had a zero for the first entry, then you
will have one blank line above the rest of your values.

Hope this helps.

Pete

On Jul 25, 10:00 am, Bretter99
wrote:
Hi,

I have a list of data in a column that are lookup answers from across
several sheets in excel 2000. the data looks something like this:

black
0
blue
0
0
0
green
0
red

(the zeros are returned from blank cells)

I want to be able to concatenate all the words with a line break between
each on but suppress the lines with a zero so my end cell looks like this:

black
blue
red
green

i can manage =concatenate(a1,char(10),a2,char(10),etc....)
but i cant think how to suppress the zeros and still get a line break after
each word.
Any help would be great thanks.
Brett





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
Chart suppression of zero's ncalpaperboy Charts and Charting in Excel 2 May 22nd 07 03:00 PM
Pivot Table Suppression of Zeros Ryan Charts and Charting in Excel 0 May 3rd 07 05:07 PM
Zero Suppression in Excel barcode fonts PHELM1 Excel Worksheet Functions 6 January 19th 06 06:09 AM
zero suppression on opening .xls file don Setting up and Configuration of Excel 1 October 26th 05 03:52 PM
Zero Suppression Irene Excel Discussion (Misc queries) 4 June 24th 05 10:21 PM


All times are GMT +1. The time now is 08:06 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"