+ Reply to Thread
Results 1 to 7 of 7

String multiple text per conditions

Hybrid View

  1. #1
    Registered User
    Join Date
    11-03-2008
    Location
    Swindon
    MS-Off Ver
    XP Office 2002
    Posts
    7

    String multiple text per conditions

    Hi all,

    Trying to concatenate cells if they meet specific criteria ie:

    A1 - dog
    A2 - dog
    A3 - dog
    A4 - cat
    A5 - cat
    A6 - cow
    A7 - cow
    A8 - cow

    Then in B1 if searching all of A:A and the result is "Dog" then put the amount of "dog" in the cell e.g "dog, dog, dog"

    B2 if searching all of A:A and the result is "Cat" then put the amount of "cat" in the cell e.g "cat, cat"

    I hope this makes sense. Thanks all inadvance. I have attached an example of how it should look once working.
    Attached Files Attached Files

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719
    To get exacly those results you can put this formula in D2 copied across

    =REPT(D1&", ",COUNTIF($A:$A,D1))

    ......but I suspect that you have a "real" problem that isn't as simple......

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    =COUNTIF(A:A,"=cat")
    or perhaps not as i just re read the post!

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482
    If D2 and copied across.

    =MID(REPT(", "&D1,COUNTIF($A:$A,D1)),3,255)

    Edit: include space between delimiter
    Cheers
    Andy
    www.andypope.info

  5. #5
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Or may be

    =REPT(D1&", ",COUNTIF($A:$A,D1)-1)&D1
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719
    I like that one oldchippy......

    Of course my version left a trailing comma space, one other option would be

    =SUBSTITUTE(REPT(", "&D1,COUNTIF($A:$A,D1)),", ","",1)

  7. #7
    Registered User
    Join Date
    11-03-2008
    Location
    Swindon
    MS-Off Ver
    XP Office 2002
    Posts
    7
    WOW

    You lot truly are genius'. Thank you all so much for your assistance. If you are keeping score I have opted to go with Mr Daddylonglegs. Cheers.

    Would a moderator please change to solved please.

    Thanks.
    Last edited by MrStyx; 12-29-2008 at 07:29 AM. Reason: Need moderator to change to solved.

+ 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