Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Bagia
 
Posts: n/a
Default Combine two or more columns by using a function

Hello,

I have combine 3 columns using the concatenate function and used CHAR(10) to
insert a new line for each column. Here's my example:

A1: 100 Main Street
B1: Suite 12
C1: Washington, DC 20016
D1: ?

So in D1, I created a function =Concatenate(A1, CHAR(10), B1, CHAR(10), C1)
and the result is perfect!

100 Main Street
Suite 12
Washington, DC 20016

My problem is when B1 column doesn't have any data, I want Excel to
eliminate the blank line. How can I get it to work? I'm lost at this point

Please help,
Thanks!
  #2   Report Post  
Nikki
 
Posts: n/a
Default Combine two or more columns by using a function

try this:

=IF(OR(B1="",B1=0),CONCATENATE(A1,CHAR(10),C1),CON CATENATE(A1, CHAR(10), B1,
CHAR(10), C1))


"Bagia" wrote:

Hello,

I have combine 3 columns using the concatenate function and used CHAR(10) to
insert a new line for each column. Here's my example:

A1: 100 Main Street
B1: Suite 12
C1: Washington, DC 20016
D1: ?

So in D1, I created a function =Concatenate(A1, CHAR(10), B1, CHAR(10), C1)
and the result is perfect!

100 Main Street
Suite 12
Washington, DC 20016

My problem is when B1 column doesn't have any data, I want Excel to
eliminate the blank line. How can I get it to work? I'm lost at this point

Please help,
Thanks!

  #3   Report Post  
Bagia
 
Posts: n/a
Default Combine two or more columns by using a function

Thank you so much Nikki!

"Nikki" wrote:

try this:

=IF(OR(B1="",B1=0),CONCATENATE(A1,CHAR(10),C1),CON CATENATE(A1, CHAR(10), B1,
CHAR(10), C1))


"Bagia" wrote:

Hello,

I have combine 3 columns using the concatenate function and used CHAR(10) to
insert a new line for each column. Here's my example:

A1: 100 Main Street
B1: Suite 12
C1: Washington, DC 20016
D1: ?

So in D1, I created a function =Concatenate(A1, CHAR(10), B1, CHAR(10), C1)
and the result is perfect!

100 Main Street
Suite 12
Washington, DC 20016

My problem is when B1 column doesn't have any data, I want Excel to
eliminate the blank line. How can I get it to work? I'm lost at this point

Please help,
Thanks!

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
Is there a function to auto-sort 2 columns? mpenkala Excel Worksheet Functions 0 November 9th 05 01:09 AM
how to combine several columns into a single column jims Excel Discussion (Misc queries) 9 August 15th 05 12:00 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
How to combine Hyperlink with Lookup function? ShaneS Excel Worksheet Functions 0 May 18th 05 01:14 PM
Need a ISWorkday Function -- Any Ideas Mark Excel Worksheet Functions 5 March 29th 05 01:58 AM


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