+ Reply to Thread
Results 1 to 11 of 11

Join text using parentheses and ignoring blanks

Hybrid View

  1. #1
    Registered User
    Join Date
    06-26-2024
    Location
    Houston, Texas
    MS-Off Ver
    365
    Posts
    20

    Join text using parentheses and ignoring blanks

    Hello,

    I need to join two columns of text (full name + nickname), putting the nickname in parentheses unless there is no nickname in which case I'd like to ignore the second column. attached is a sample that includes three formulas i've attempted.

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,867

    Re: Join text using parentheses and ignoring blanks

    Try

    =IF(B2<>"",A2 & " (" &B2 & ")",A2)
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    06-26-2024
    Location
    Houston, Texas
    MS-Off Ver
    365
    Posts
    20

    Re: Join text using parentheses and ignoring blanks

    Thank you!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,979

    Re: Join text using parentheses and ignoring blanks

    Administrative Note:

    Is your forum profile showing ONLY the oldest Excel PRODUCT that you need this to work for?

    Members will tailor the solutions they offer to the Office PRODUCT (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your product is for Mac, please also state this.

    The three most recent Excel products are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the version number in your profile (e.g. MS365 Version 2306). This is in the About Excel section further down the Account page.

    Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    06-26-2024
    Location
    Houston, Texas
    MS-Off Ver
    365
    Posts
    20

    Re: Join text using parentheses and ignoring blanks

    I'll do this, thank you.

  6. #6
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,038

    Re: Join text using parentheses and ignoring blanks

    Another way
    =TRIM(A2&SUBSTITUTE(" ("&B2&")","()",""))

  7. #7
    Registered User
    Join Date
    06-26-2024
    Location
    Houston, Texas
    MS-Off Ver
    365
    Posts
    20

    Re: Join text using parentheses and ignoring blanks

    I appreciate the alternative - thanks!

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,787

    Re: Join text using parentheses and ignoring blanks

    Or with textjoin
    Formula: copy to clipboard
    =TEXTJOIN({" (",")"},TRUE,A2,B2)&IF(B2="","",")")

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,979

    Re: Join text using parentheses and ignoring blanks

    Or this, maybe?

    =A2&IF(B2="",""," ("&B2&")")

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,979

    Re: Join text using parentheses and ignoring blanks

    You're welcome.

  11. #11
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,787

    Re: Join text using parentheses and ignoring blanks

    Glad to help & thanks for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Text Join Indirect is including blanks
    By yorkshirewhite in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-10-2022, 05:14 PM
  2. Text join Dates, ignore duplicates and blanks
    By dandanrolando in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 07-20-2022, 10:52 AM
  3. Text join ignoring blanks but limited to a maximum of five entries
    By JFawcett in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-26-2020, 03:54 AM
  4. [SOLVED] SUMIF, ignoring blanks and find earliest date ignoring blanks
    By Chris_Devon in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2019, 10:16 AM
  5. [SOLVED] Count or Sum Ignoring Specified Text & Blanks
    By mycon73 in forum Excel General
    Replies: 3
    Last Post: 11-24-2018, 03:26 AM
  6. [SOLVED] return text ignoring text in parentheses
    By Mike Brewer in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-24-2016, 10:00 AM
  7. [SOLVED] Extracting all text from parentheses (including parentheses)
    By j4ke101 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-10-2013, 08:03 AM

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