Share via

Need to organize first data sheet into the second with duplicates of each project for each date with a value.

Pacis, Jam 20 Reputation points
2026-03-13T16:44:34.9133333+00:00

User's image

User's image

Thank you,

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments
{count} votes

Answer accepted by question author
  1. Hendrix-C 13,005 Reputation points Microsoft External Staff Moderator
    2026-03-13T17:42:54.47+00:00

    Hi @Pacis, Jam,

    Based on your sharing, can you confirm whether this is your expected outcome:

    User's image

    If that's the case, you can use achieve this result with this formula:

    =LET(projects,$A$3:$A$20,dates,$B$1:$H$1,hours,$B$3:$H$20,r,ROWS(hours),c,COLUMNS(hours),n,SEQUENCE(r*c),proj,INDEX(projects,ROUNDUP(n/c,0)),dt,INDEX(dates,1,MOD(n-1,c)+1),hrs,TOCOL(hours,0,FALSE),FILTER(HSTACK(proj,dt,hrs),(proj<>"")*(hrs<>"")))
    

    If I have misunderstood anything about your request, please notify me so I can clearly understand the situation to provide the best guidance for your concern.

    If you have any questions or need further assistance, please feel free to share them in the comments so I can continue to support you.

    Thank you for your patience and understanding. I'm looking forward to your reply.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Q&A Assist
    2026-03-13T17:10:25.0566667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Use a method that converts the weekly “matrix” layout into a simple list. Power Query is the most flexible for this.

    Assume the first layout is in a sheet named WeekData, with headers in row 1 and projects in column A.

    1. Turn the range into a table
      1. Select any cell in the first sheet.
      2. Press Ctrl+T and confirm “My table has headers”.
    2. Load the table into Power Query
      1. Go to Data > Get Data > From Other Sources > Blank Query.
      2. In the formula bar, enter:
              =Excel.CurrentWorkbook()
        
      3. In the list, find the table created in step 1 and click the Table link in its Content column.
    3. Unpivot the date columns
      1. In Power Query, select the PROJECT column.
      2. On the Transform tab, choose Unpivot Columns > Unpivot Other Columns.
        • This produces three columns: PROJECT, Attribute, and Value.
        • Attribute contains the date headers (3/1/2026, 3/2/2026, …).
        • Value contains the hours (1, 2, etc.).
    4. Clean up the result
      1. Rename columns:
        • PROJECTProject
        • AttributeDate
        • ValueRegular Hours (or Overtime if this table is for overtime).
      2. Filter out blanks in Regular Hours so only rows with a value remain.
    5. Load to the second sheet
      1. Select Home > Close & Load.
      2. Choose Table and the destination sheet that has the Project / Date / Regular Hours / Overtime headers.

    The result is a list where each non‑blank cell from the original grid becomes one row with:

    • Project = project number
    • Date = column header date
    • Regular Hours = the value from the grid

    If overtime is tracked separately, repeat the same steps for the overtime table and load into the same destination sheet (append) with Overtime as the value column.


    References:

    0 comments No comments

  2. Colin Grinham 0 Reputation points
    2026-03-13T17:07:02.9466667+00:00

    This is a classic data transformation / normalisation task. You can automate it using Power Query or Excel formulas.

    Option A — Power Query (best for large datasets)

    Select your first table → Data > From Table/Range

    In Power Query, use Unpivot Columns to create a row for each project/date/value.

    Rename columns to match the second sheet’s structure.

    Close & Load into the second sheet.

    Option B — Formula-based (if dates are in columns)

    If your first sheet looks like:

    | Project | 1 Jan | 2 Jan | 3 Jan | … |

    Use this formula to flatten it:

    Code

    =LET(
        data, A2:D10,
        proj, TAKE(data,,1),
        dates, TAKE(A1:D1,,-1),
        vals, DROP(data,,1),
        HSTACK(
            INDEX(proj, SEQUENCE(ROWS(vals)*COLUMNS(vals),,1,1)),
            INDEX(dates, SEQUENCE(,COLUMNS(vals),1,1)),
            TOROW(vals,1)
        )
    )
    

    This produces a list of Project | Date | Value.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.