+ Reply to Thread
Results 1 to 2 of 2

Count results, add punctuation

  1. #1
    Registered User
    Join Date
    08-03-2011
    Location
    Norwich
    MS-Off Ver
    Excel 2010
    Posts
    28

    Count results, add punctuation

    Hi Guys

    This is more of a theory question than something I have in practice.

    Basically say I had 4 names stored in a database and I wanted to print them, how could I print them with a comma between the 1st three and then and ampersand before the last result?
    So name1, name2, name3 & name4

    Also if the count is just one result, how could you print just name1 without any punctuation symbols??

    Using Excel 2010 VBA

    Cheers

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Count results, add punctuation

    Hi Herghost,


    Try using below formula:-

    =IF(COUNTA(A:A)=1,A1,A1&", "&A2&", "&A3&" & "&A4)

    See attachment:-
    concatenating names.xlsx

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

+ 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