+ Reply to Thread
Results 1 to 5 of 5

Concatenate Function Modification

  1. #1
    Registered User
    Join Date
    10-17-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    71

    Question Concatenate Function Modification

    I'm looking for help in modifying the concatenate function below to add "and" before the last string in the function. Currently, using the function on a selected range returns cell values strung together by ", " // For example: CellA, CellB, CellC.

    I am trying to figure out how to modify the function so it will return the following: CellA, CellB, and CellC. Any help is much appreciated!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Concatenate Function Modification

    try this

    Please Login or Register  to view this content.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    10-17-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    71

    Re: Concatenate Function Modification

    Hi humdingaling! Thanks for your response and solution. It is working, but I have 2 more contingencies I'm hoping you could help me add to this function:

    1. If the number of cells being concatenated is EQUAL to 1, then return the cell value as it is (no separator)
    2. If the number of cells being concatenated is EQUAL to 2, then return "and" between the two cell values (EX: Christy and Diane)

    Everything else is working great as long as there are 3 cells or more that are being concatenated. I've tried modifying your code above, but haven't been able to achieve what I described. Your help is once again greatly appreciated!

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Concatenate Function Modification

    1. If the number of cells being concatenated is EQUAL to 1, then return the cell value as it is (no separator)
    are you talking accounting for blank cells?
    as in if your range is 3 but only 1 has data?

    2. If the number of cells being concatenated is EQUAL to 2, then return "and" between the two cell values (EX: Christy and Diane)
    the UDF already does this?

  5. #5
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Concatenate Function Modification

    amended code to deal with too many blanks

    Please Login or Register  to view this content.
    replace your case zero with something else you want
    just blank maybe?

+ 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] Modification of the function CountIfs VBA
    By LinaInverse13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2014, 03:40 AM
  2. FileName / Path Function Modification
    By Richard_Thornton in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-21-2014, 03:52 AM
  3. [SOLVED] I want a little bit of modification to normal VLOOKUP function.
    By Thor Almighty in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-08-2013, 01:05 AM
  4. Concatenate with If function?
    By christlivethinme in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 06-13-2013, 04:21 AM
  5. Using the CONCATENATE function nested in an IF function
    By rottweiler_lvr in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-07-2013, 10:02 PM
  6. Concatenate and if function used together
    By Connie5761 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 12-05-2012, 02:00 PM
  7. concatenate function
    By Nospam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2006, 08:50 PM

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