+ Reply to Thread
Results 1 to 8 of 8

Need help with a CountA formula that concatenates

  1. #1
    Registered User
    Join Date
    02-24-2017
    Location
    Philadelphia, PA
    MS-Off Ver
    Office 365
    Posts
    4

    Need help with a CountA formula that concatenates

    Here is the formula. It refers to a list of names:

    Name List

    John Smith
    Mary Smith
    Lou Philips
    Jenny Mao
    Philip Long

    =IF(COUNTA(B1:B6)=1,B1,IF(COUNTA(B1:B6)=2,CONCATENATE(B1," and ",B2),IF(COUNTA(B1:B6)=3,CONCATENATE(B1,", ",B2,","," and ",B3),IF(COUNTA(B1:B6)=4,CONCATENATE(B1,", ",B2,", ",B3,","," and ",B4),IF(COUNTA(B1:B6)=5,CONCATENATE(B1,", ",B2,", ",B3,", ",B4,","," and ",B5),IF(COUNTA(B1:B6)=6,CONCATENATE(B1,", ",B2,", ",B3,", ",B4,", ",B5,","," and ",B6)," "))))))

    Basically, I have allotted for up to 6 names to be concatenated with commas and "and" on output. I need to find a way to allow for an unlimited amount of concatenated names. Output example would be as follows:

    John Smith, Mary Smith, Lou Philips, Jenny Mao, and Philip Long

    Please let me know if you need more data.

    Thank you in advance for your help!

    Shannon

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Need help with a CountA formula that concatenates

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    02-24-2017
    Location
    Philadelphia, PA
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Need help with a CountA formula that concatenates

    I will give this a try! Thank you so much for your response!

    How would I end the concatenation with "and"?

    Shannon
    Last edited by shannonandreas113; 02-24-2017 at 07:35 PM.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Need help with a CountA formula that concatenates

    Ahh good Question.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by mehmetcik; 02-25-2017 at 01:08 PM.

  5. #5
    Registered User
    Join Date
    02-24-2017
    Location
    Philadelphia, PA
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Need help with a CountA formula that concatenates

    Thanks! However, "and"-1 will only work if the row data stops at B5 or B7, etc. I need to allow for unlimited rows or at least 20 (so, B1:B2), but not all outputs are going to have 20. Does that make sense? Some might have 5 or 6 or 1.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,899

    Re: Need help with a CountA formula that concatenates

    The proposed solution is a 'low tech' (uses a helper column in XFD) method. The formula for the helper column is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    the formula has been copied down to XFD52 so that accommodates up to 50 names however if you have more names you could copy it as far down the column as needed. The result is then displayed in B3 which references XFD52, so if you copy the formula further down column XFD just change the cell reference in B3.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    02-24-2017
    Location
    Philadelphia, PA
    MS-Off Ver
    Office 365
    Posts
    4

    Re: Need help with a CountA formula that concatenates

    You are brilliant! Worked splendidly. Thank you so much!!!

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,899

    Re: Need help with a CountA formula that concatenates

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. [SOLVED] Formula that Adds Values from Matching Concatenates (Pics Work Now)
    By johncw12 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-26-2015, 12:34 PM
  2. If statement concatenates results into 1 cell - Programming Try
    By Karroog in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-17-2014, 03:35 AM
  3. If statement concatenates results into 1 cell
    By Karroog in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-16-2014, 02:37 PM
  4. Formula that recoginizes partial text matches and concatenates them
    By Shadefalcon in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-02-2014, 04:11 PM
  5. [SOLVED] Conditional formatting with a cell that concatenates
    By tatumrae in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-12-2013, 12:29 PM
  6. Displaying Data using Countifs & Concatenates
    By woodland81 in forum Excel General
    Replies: 0
    Last Post: 06-07-2012, 01:53 PM
  7. Removing concatenates for VBA calculs
    By Werner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-29-2005, 02:21 PM

Tags for this Thread

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