+ Reply to Thread
Results 1 to 4 of 4

Concatenate across same products

  1. #1
    Registered User
    Join Date
    10-14-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    2

    Concatenate across same products

    Hi All,

    I have the following table (starting in cell A1)

    Product Order Number
    A 5551
    B 2263
    B 5561
    B 5555
    C 5587
    C 1204
    C 1203
    C 6430
    D 6430
    D 2240
    D 5548
    D 5549
    D 5575
    E 2268
    E 2269
    E 5539
    E 5565
    E 5535
    E 5536
    F 2254
    F 2279
    F 2255
    F 2256
    F 2257
    F 5537
    F 5538
    F 2252
    F 2253

    I am trying to concatenate all the order numbers for the same product (with a space).

    I have attempted with the following formula but can only seem to get a maximum of 2 order numbers:

    (In cell C4)

    =IF(A4=A3,CONCATENATE(B4&" "&B3),B4)

    (this returns - '5561 2263')

    Is there a way to get all the order numbers together (in a general formula, as this is only small portion of the data-set)? So for example, for product C, I want the formula to return '5587 1204 1203 6430'.

    Any help is appreciated.

    Thanks!

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Concatenate across same products

    Here's a UDF (User Defined Function) to do this for you. Enable macros on opening.

    the formula takes the form =Concatall(if(range=criterion,range,"delimiter")

    Array enter this formula. Array Formulae are a little different from ordinary formulas in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly braces { } appear around the outside of your formula. If you do not CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly braces yourself - it won't work...

    =concatall(IF($A$2:$A$29=D9,$B$2:$B$29,""),", ")

    where D9 contains the first of your products.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    10-14-2015
    Location
    UK
    MS-Off Ver
    2013
    Posts
    2

    Re: Concatenate across same products

    Thank you very much Glenn! This is perfect.

    Not sure why the 'ConcatAll' function did not come up in my version of Excel but I copied all my data into your spreadsheet and it works fine...

    Thanks again for the swift response and the handy lesson.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Concatenate across same products

    I was in a bit of a hurry yesterday. A UDF is a specially written routine that requires some code to make it go. You can see it by right clicking on the Tab snd select View Code. The relevant code is in module 1.

    Thanks for the Rep

+ 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. Products and Prices
    By ChrisJG in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-09-2015, 10:40 AM
  2. Concatenate with Double Info in Concatenate Cell
    By MRoz in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-10-2015, 02:07 PM
  3. Formula to work out how many products among various products!
    By MissConfussed in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-02-2013, 02:24 PM
  4. Separating different products
    By stianabra in forum Excel General
    Replies: 1
    Last Post: 09-01-2010, 04:24 PM
  5. Replies: 2
    Last Post: 04-12-2010, 12:35 PM
  6. [SOLVED] [SOLVED] I know how to concatenate ,can one de-concatenate to split date?
    By QUICK BOOKS PROBLEM- in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-26-2005, 01:05 PM
  7. [SOLVED] Products
    By Gene in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-20-2005, 08:07 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