+ Reply to Thread
Results 1 to 7 of 7

Combining Two Tables in an Unusual Way

  1. #1
    Registered User
    Join Date
    08-20-2018
    Location
    Mass, USA
    MS-Off Ver
    MS365 version 2303
    Posts
    28

    Combining Two Tables in an Unusual Way

    Hi,

    I am sure that there is an efficient solution to this, but I'm really not sure how to word my question to google in a way that gives me a helpful answer.

    I am trying to make an efficient "part number generator".
    This is the way it needs to work:

    Table 1: Materials
    This table will hold a few hundred different materials.


    Table 2: Sizes
    This table holds thousands of different sizes.


    Table 3: Part Numbers
    This table will take each individual material and concatenate that material with every size.


    I have managed to complete this task with "counters" in what I consider to be an inefficient method.
    Is there a better way to do this using a purpose built excel function or Power Query?

    Please see the attached spreadsheet for examples.
    The "GOAL" tab provides the raw data. The "inefficient method" tab shows how I have done it in the past.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,847

    Re: Combining Two Tables in an Unusual Way

    Administrative Note:

    Is your forum profile showing the version of Excel that you need this to work for?

    Members will tailor the solutions they offer to the version of Office (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this.

    The three most recent versions of Excel are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the release number in your profile (e.g. MS365 Version 2211). This is in the About Excel section further down the Account page.

    Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-20-2018
    Location
    Mass, USA
    MS-Off Ver
    MS365 version 2303
    Posts
    28

    Re: Combining Two Tables in an Unusual Way

    Hi, sorry about that - My Excel is MS365 version 2303. I have updated my account to match. I'm using windows.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,847

    Re: Combining Two Tables in an Unusual Way

    OK. Try this, then:

    =LET(a,TRANSPOSE(TEXTSPLIT(TRIM(TEXTJOIN(" ",,REPT(Table18[Material]&" ",MAX(Table29['#]))))," ")),b,TRANSPOSE(TEXTSPLIT(TRIM(REPT(TEXTJOIN(" ",,Table29[Size])&" ",MAX(Table18['#])))," ")),n,SEQUENCE(COUNTA(a),,1,1),CHOOSE({1,2},n,a&b))
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-20-2018
    Location
    Mass, USA
    MS-Off Ver
    MS365 version 2303
    Posts
    28

    Re: Combining Two Tables in an Unusual Way

    Thanks for the help!

  6. #6
    Registered User
    Join Date
    08-20-2018
    Location
    Mass, USA
    MS-Off Ver
    MS365 version 2303
    Posts
    28

    Re: Combining Two Tables in an Unusual Way

    I'm still running into an issue here though. Textjoin can only join a maximum of 252 text arguments. I will have thousands of sizes, which mean that Excel gives a "#CALC!" error when trying to use this equation with a full dataset.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,847

    Re: Combining Two Tables in an Unusual Way

    It should be doable with Power Query. Nighttime here - will have another look tomorrow.

+ 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. Need help in combining 3 tables
    By joeldcph in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-02-2019, 09:36 PM
  2. Combining two tables into a pivot
    By c.drysdale89 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 03-04-2016, 07:33 AM
  3. Combining two tables
    By b3118085 in forum Excel General
    Replies: 1
    Last Post: 11-18-2014, 07:32 PM
  4. Excel 2007 : Combining Tables
    By amariepsu in forum Excel General
    Replies: 1
    Last Post: 01-06-2010, 10:24 AM
  5. Combining 2 tables
    By watz in forum Excel General
    Replies: 3
    Last Post: 08-08-2006, 09:35 AM
  6. Combining tables in many sheets to one
    By Turnipboy in forum Excel General
    Replies: 3
    Last Post: 10-16-2005, 03:35 PM
  7. Combining Tables
    By metrueblood in forum Excel General
    Replies: 3
    Last Post: 02-02-2005, 07:06 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