+ Reply to Thread
Results 1 to 9 of 9

How to create a cell of IDs of related products (in the row of an original product)?

Hybrid View

  1. #1
    Registered User
    Join Date
    11-25-2019
    Location
    Netherlands
    MS-Off Ver
    Office 2019
    Posts
    5

    Lightbulb How to create a cell of IDs of related products (in the row of an original product)?

    Hi All,

    I would like to create a product feed for my company, where each row represents a product. Sometimes a product has some additional feature, which acts as a separate new product (in a new row).

    Example:

    Main product -> ID:1
    Main product with feature #1 -> ID: 1.1
    Main product with feature #2 -> ID: 1.2
    Main product with feature #3 -> ID: 1.3

    After all this, in a certain product row I would like to display the other 3 products as "related items" in a separate column. So If the visitor is on the product page of the "Main product" he/she should see Main product with feature #1, Main product with feature #2 and Main product with feature #3 as related products.
    Therefore I would like to display always the other productsī product IDs in a single cell for a certain product.

    Example:
    In the row of my Main product (ID: 1) I would like to see a column (related products) with "1.1, 1.2, 1.3".

    OR

    In the row of my Main product with feature #1 (ID: 1.1) I would like to see a column (related products) with "1, 1.2, 1.3".


    I hope this makes sense. Thank you very much for your help in advance!
    Attached Files Attached Files
    Last edited by matecsernak; 11-25-2019 at 10:54 AM. Reason: adding attachment

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,765

    Re: How to create a cell of IDs of related products (in the row of an original product)?

    Can you upload sample file, please.
    Check yellow banner at the top.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Registered User
    Join Date
    11-25-2019
    Location
    Netherlands
    MS-Off Ver
    Office 2019
    Posts
    5

    Re: How to create a cell of IDs of related products (in the row of an original product)?

    Sorry, didnīt see. I added the file.

  4. #4
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,765

    Re: How to create a cell of IDs of related products (in the row of an original product)?

    Try into C3:

    Formula: copy to clipboard
    =IF(A3<>"",SUBSTITUTE(TEXTJOIN("",1,IF(IFERROR(FIND(LEFT(A3,7),$A$3:$A$18),0)<>0,$A$3:$A$18&", ","")),A3&", ",""),"")


    accept with Ctrl+Shift+Enter (as it is array formula).
    Then drag it down as long as needed.


    A
    B
    C
    1
    ID name related_products
    2
    PALACE
    3
    801_005 Climbing Frame for Children - Jungle Palace 801_005 - 850_176, 801_005 - 850_177, 801_005 - 850_230,
    4
    801_005 - 850_176 Climbing Frame with Swing - Palace 1-Swing 801_005, 801_005 - 850_177, 801_005 - 850_230,
    5
    801_005 - 850_177 Playhouse with Slide and Swing - Palace 2-Swing 801_005, 801_005 - 850_176, 801_005 - 850_230,
    6
    801_005 - 850_230 Playtower with Climbing Wall - Palace Climb 801_005, 801_005 - 850_176, 801_005 - 850_177,
    7
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-25-2019
    Location
    Netherlands
    MS-Off Ver
    Office 2019
    Posts
    5

    Re: How to create a cell of IDs of related products (in the row of an original product)?

    Nevermind! Found the information about the arrayformula. Now it works fine, thank you!
    Last edited by matecsernak; 11-25-2019 at 12:05 PM. Reason: solved

  6. #6
    Registered User
    Join Date
    11-25-2019
    Location
    Netherlands
    MS-Off Ver
    Office 2019
    Posts
    5

    Lightbulb Re: How to create a cell of IDs of related products (in the row of an original product)?

    One more thing. What if I have much more products that are irrelevant and I would not display anything in those rows?
    The 4 relevant product types are the ones ending on:

    - regular 7 digit IDs
    - 850_176
    - 850_177
    - 850_230

    All other ID products should be irrelevant to this calculation thus cell left blank. Is this something thatīs possible to add to the above mentioned formula?
    Thank you very much!
    Attached Files Attached Files

  7. #7
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,765

    Re: How to create a cell of IDs of related products (in the row of an original product)?

    In relation to attachment. Why C6:C9 should be blank?

  8. #8
    Registered User
    Join Date
    11-25-2019
    Location
    Netherlands
    MS-Off Ver
    Office 2019
    Posts
    5

    Re: How to create a cell of IDs of related products (in the row of an original product)?

    Because I only want to display the related product IDs in column C if the original ID ends on one of these 4:

    - regular 7 digit IDs (for example: 801_005)
    - 850_176 (for example: 801_005 - 850_176)
    - 850_177 (for example: 801_005 - 850_177)
    - 850_230 (for example: 801_005 - 850_230)

    You can see that my examples are the same products because all of them start with 801_005 only they are different variations. And ultimately I would only want to display the related products in column C of items that end on those above mentioned 3 numbers + the original regular ID (801_005)

    EDIT: Maybe itīs a solution to exclude in the function somehow products that have IDs ending on 240, 247, 261 and 74?
    Last edited by matecsernak; 11-26-2019 at 09:50 AM. Reason: EDIT: maybe exclude products with ending on certain ID numbers?

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,839

    Re: How to create a cell of IDs of related products (in the row of an original product)?

    See if the following array entered formula, which is just a modification of KOKOSEK's formula, does what you want:
    Formula: copy to clipboard
    =IF(OR(LEN(A2)=7,RIGHT(A2,3)="176",RIGHT(A2,3)="177",RIGHT(A2,3)="230"),SUBSTITUTE(TEXTJOIN("",1,IF(IFERROR(FIND(LEFT(A2,7),$A$2:$A$236)*((RIGHT(A$2:A$236,3)="176")+(RIGHT(A$2:A$236,3)="177")+(RIGHT(A$2:A$236,3)="230")+(LEN(A$2:A$236)=7)),0)<>0,$A$2:$A$236&", ","")),A2&", ",""),"")

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] Create new workbook named for Cell in original workbook and copy some sheets from original
    By ANDREAAS in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-09-2019, 01:40 PM
  2. Replies: 4
    Last Post: 02-26-2018, 01:01 PM
  3. Replies: 1
    Last Post: 05-12-2016, 09:29 AM
  4. [SOLVED] VBA to to create a list of product variations based on list of parent products
    By irruzzz in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-12-2016, 08:27 AM
  5. [SOLVED] Formula to List of Product Groups That Have The Most Products With Zero Sales
    By chaddug in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-23-2015, 06:12 AM
  6. Find and go to product code in a list of products
    By ALANBERNARD in forum Excel General
    Replies: 5
    Last Post: 06-05-2013, 09:28 AM
  7. Finding the greater product of two sets of products and then some
    By bruce42 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-14-2008, 06:40 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