How to combine multiple rows of data into one row based off of one cell value.

Hello Smartsheet's community!


I am back with another question. I have a database that holds the tracking of employee trainings. The training structure is in tiers and after each completed tier they fill out a form. The raw data from this forms looks like this:

image.png

Depending on an employee's level they will have a differing amount of rows entered.

Example: L1 employees will have 2 rows filling in all of the green columns.


I am looking to create a spreadsheet that combines/concatenates all of this data into one row based off of the "Alias" value.

Example: "Test 1" employee only has 1 row filling all green columns with "trained".


End result to look like this:

image.png


The reason for needing this is I am trying to create a dashboard that shows each employees training completion and if/what training's they are missing.


As always appreciate the help!

Thanks :)

Best Answer

  • TVang
    TVang ✭✭✭✭✭
    edited 06/03/21 Answer ✓

    Here’s one approach. Use the functions JOIN() and COLLECT() in your new sheet.

    Untitled.jpg

    You’ll need to COLLECT everything from the training column in the raw data worksheet (Sheet1), where the alias in the Alias column matches the alias found in the new sheet (Sheet2). And then JOIN the results.

    •  JOIN( COLLECT( {Sheet1 COL1} , {Sheet1 Alias} ,  [Alias]@row ) )
    • JOIN( COLLECT( {Sheet1 COL2} , {Sheet1 Alias} ,  [Alias]@row ) )
    • JOIN( COLLECT( {Sheet1 COL3} , {Sheet1 Alias} ,  [Alias]@row ) )
    • JOIN( COLLECT( {Sheet1 COL4} , {Sheet1 Alias} ,  [Alias]@row ) )
    • JOIN( COLLECT( {Sheet1 COL5} , {Sheet1 Alias} ,  [Alias]@row ) )

    In the new worksheet (Sheet2), create data references for each of the columns that you’ll need from the source sheet, Sheet1.

    To do this, right-click anywhere in Sheet2 and select Manage References… from the pop-up. Then create the references you’ll need.

    • Sheet1 Alias would be the entire “Alias” column.
    • Sheet1 COL1 would be the next column. In your environment, COL1 would be the column labeled, “Level”.
    • Sheet1 COL2 would be “Dish”.

    And so on…

    Once the references are created, enter the formula,

     = JOIN(COLLECT( {Sheet1 COL1} , {Sheet1 Alias} ,  [Alias]@row ))

     into the first column after the Alias. Then subsequently,

     = JOIN(COLLECT( {Sheet1 COL2} , {Sheet1 Alias} ,  [Alias]@row ))

     …and so on.

    Cheers!


    Reference Smartsheet functions here: https://help.smartsheet.com/functions

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!