Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Concatenate question

I tried posting this yesterday but haven't seen it.

I am using this formula to concatenate.

=(A1&", "&B1&", "&C1&", "&D1&", "&E1&", "&F1&", "&G1&", "&H1)

Some of the cells are blank. How can I change the formula so the
double commas ', , ' won't show.

Thank you.
David

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Concatenate question

=(A1&", "&B1&", "&C1&", "&D1&", "&E1&", "&F1&", "&G1&", "&H1)

where you have A1&", "& change to

if(A1="","",A1&", ")

Do it for each similar segment in including H1 so H1 will also have a ", "

Let's call that the newformula (without the equal sign).

then do

=Left(newformula,len(newformula)-2)

If all the cells could be blank

=if(counta(A1:H1)=0,"",Left(newformula,len(newform ula)-2))

--
Regards,
Tom Ogilvy


"yovation" wrote:

I tried posting this yesterday but haven't seen it.

I am using this formula to concatenate.

=(A1&", "&B1&", "&C1&", "&D1&", "&E1&", "&F1&", "&G1&", "&H1)

Some of the cells are blank. How can I change the formula so the
double commas ', , ' won't show.

Thank you.
David


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Concatenate question

assuming your formula is in column I, maybe try something like this in column
J:

=LEFT(SUBSTITUTE(I1, " ,", ""), LEN(SUBSTITUTE(I1, " ,", ""))-2)


--
Hope that helps.

Vergel Adriano


"yovation" wrote:

I tried posting this yesterday but haven't seen it.

I am using this formula to concatenate.

=(A1&", "&B1&", "&C1&", "&D1&", "&E1&", "&F1&", "&G1&", "&H1)

Some of the cells are blank. How can I change the formula so the
double commas ', , ' won't show.

Thank you.
David


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Concatenate question

Thank you Tom and Vergel,

I tried the formula below and it works great.

On Jul 17, 12:10 pm, Vergel Adriano
wrote:
assuming your formula is in column I, maybe try something like this in column
J:

=LEFT(SUBSTITUTE(I1, " ,", ""), LEN(SUBSTITUTE(I1, " ,", ""))-2)

--
Hope that helps.

Vergel Adriano


  #5   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default Concatenate question

David

Replace all the " , " with an if statement that checks the cell to the
left and puts a blank instead of " , " if the cell is blank. For
example:

=A1&IF(a1<"",",","")&B1&IF(b1<"",",","")&C1&IF(C 1<"",",","")&D1

Good luck.

Ken
Norfolk, Va



On Jul 17, 12:39 pm, yovation wrote:
I tried posting this yesterday but haven't seen it.

I am using this formula to concatenate.

=(A1&", "&B1&", "&C1&", "&D1&", "&E1&", "&F1&", "&G1&", "&H1)

Some of the cells are blank. How can I change the formula so the
double commas ', , ' won't show.

Thank you.
David





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 question scubadiver Excel Discussion (Misc queries) 4 May 21st 08 05:02 PM
Concatenate question DianaL Excel Worksheet Functions 4 March 27th 08 02:26 PM
CONCATENATE Question Anthony Excel Discussion (Misc queries) 4 March 16th 08 11:31 PM
Concatenate Question Dan R. Excel Programming 2 March 15th 07 03:23 PM
Concatenate question nick Excel Worksheet Functions 3 July 27th 06 11:40 PM


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