+ Reply to Thread
Results 1 to 5 of 5

how to combine text with a semicolon if there's text in 2 columns

  1. #1
    Registered User
    Join Date
    12-21-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2008
    Posts
    14

    Exclamation how to combine text with a semicolon if there's text in 2 columns

    Hi,

    Is there ONE forum for that can take care of the following situations:

    Text in column A
    Text in column B
    Column C = A; B

    Text in column A
    NO text in column B
    Column C = A

    NO text in column A
    Text in column B
    Column C = B

    Sample sheet of how I'd like column C to be attached.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: how to combine text with a semicolon if there's text in 2 columns

    In C2, then copy downward:

    =IF(COUNTA(A2:B2)=2, A2&"; "&B2, A2&B2)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    12-21-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2008
    Posts
    14

    Re: how to combine text with a semicolon if there's text in 2 columns

    Thanks for the response. That formula works for the first option, but doesn't address Options 2 & 3 where I still want it to display any text in cells A & B without the semi colon

  4. #4
    Registered User
    Join Date
    12-21-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2008
    Posts
    14

    Re: how to combine text with a semicolon if there's text in 2 columns

    OK, looks like there was an issue with hidden text in my columns. It works! Thanks so much.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: how to combine text with a semicolon if there's text in 2 columns

    So, turns out your new formula not only does what you want, it also serves to reveal hidden data in cells that appear empty but are not.... bonus!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1