+ Reply to Thread
Results 1 to 6 of 6

Number of unique customers for every possible product combination? (2007 CSE)

Hybrid View

  1. #1
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Number of unique customers for every possible product combination? (2007 CSE)

    Column 3:

    add this code to a new module in the VB editor (Alt+F11)

    Function aconcat(a As Variant, Optional sep As String = "") As String
    ' Harlan Grove, Mar 2002
    Dim y As Variant
    
    If TypeOf a Is Range Then
    For Each y In a.Cells
    aconcat = aconcat & y.Value & sep
    Next y
    ElseIf IsArray(a) Then
    For Each y In a
    aconcat = aconcat & y & sep
    Next y
    Else
    aconcat = aconcat & a & sep
    End If
    
    aconcat = Left(aconcat, Len(aconcat) - Len(sep))
    End Function
    then assuming your data is in A1:B5, use:

    =SUBSTITUTE(TRIM(aconcat(IF($B$1:$B$5=B1,$A$1:$A$5,"")," "))," ",",")

    and confirm with CTRL+SHIFT+ENTER not just ENTER

    copy down...

    This separate entries with comma, you can change that... by changing the symbol between double quotes in last part of the formula.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  2. #2
    Forum Contributor
    Join Date
    04-26-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2016
    Posts
    241

    Re: Number of unique customers for every possible product combination? (2007 CSE)

    Oh my goodness, MBVC, I am so pleased to find your post, and so excited to try the solution that you *developed*!!

    Unfortunately, it's bedtime here now. I'll report back my results to you tomorrow.

    But in the meantime, again, many, many thanks!!!

    Jay

  3. #3
    Forum Contributor
    Join Date
    04-26-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2016
    Posts
    241

    Re: Number of unique customers for every possible product combination? (2007 CSE)

    NBVC,

    I had to stay up late and check out your solution....

    ...and it works!!!!!!!


    Infinite thanks and sincerest gratitude!!

    You made my day,

    Cheers,

    Jay

+ 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