+ Reply to Thread
Results 1 to 3 of 3

Dynamically Unpivot without Power Query with Merge Columns and Rows

  1. #1
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,067

    Dynamically Unpivot without Power Query with Merge Columns and Rows

    Hello Excel Gurus,

    Without using Power Query, how do you unpivot columns and have the result to be in dynamic array with an additional "break"?

    PS: I'm only looking for a formula. Not VBA or Power Query.

    For example, the raw data is given from cell A1 to F5. I'd like to have it return in a dynamic array shown in cell J1 to N15. Yes including "custom" header

    The custom header is 'Product', 'Count Type' and 'Actual'. <-- I can accept it to be a static header if it's not doable.

    Notice too that when it's to a new "week", there's an empty row that act as a separator.

    Thank you in advanced.

    Dynamically Unpivot without Power Query including Custom Headers.png

  2. #2
    Forum Contributor John Vergara's Avatar
    Join Date
    01-17-2022
    Location
    Colombia
    MS-Off Ver
    365
    Posts
    200

    Re: Dynamically Unpivot without Power Query with Merge Columns and Rows

    Hi dluhut!

    Check this formula:
    PHP Code: 
    =LET(r,A3:B5,h,C1:F1,c,COLUMN(h),v,C3:F5,DROP(REDUCE(HSTACK(A1:B1,{"Product","Count Type","Actual"}),SEQUENCE(ROWS(r)),LAMBDA(i,x,VSTACK(i,HSTACK(INDEX(r,IFNA(EXPAND(x,COLUMNS(v)),x),SEQUENCE(,COLUMNS(r))),TRANSPOSE(VSTACK(LOOKUP(c,c/(h>""),h),C2:F2,INDEX(v,x,)))),T(+SEQUENCE(,5))))),-1)) 
    File attached. Blessings!

  3. #3
    Valued Forum Contributor
    Join Date
    04-13-2011
    Location
    Ottawa, Canada
    MS-Off Ver
    365
    Posts
    1,067

    Re: Dynamically Unpivot without Power Query with Merge Columns and Rows

    Solved and reps up to you @John Vergara!

    I modified your formula a little to have the formula take the last column and last row. So that if new data is added, it'll automatically populate

+ 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. Power Query - unpivot with 2 value columns
    By RE_NERO in forum Excel General
    Replies: 4
    Last Post: 04-19-2023, 11:20 AM
  2. [SOLVED] [Power Query] Unpivot Columns and then Append them
    By DizerX in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-24-2022, 03:48 AM
  3. Unpivot Columns without Power Query
    By dluhut in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-30-2022, 06:38 AM
  4. [SOLVED] Unpivot data in two columns in Power Query
    By Yaghoub61 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 08-13-2021, 12:12 AM
  5. Power query - unpivot data that has multiple headings
    By annaisakiwi in forum Excel General
    Replies: 11
    Last Post: 05-04-2020, 09:54 PM
  6. Unpivot in Power Query keeping two columns
    By PennyK in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-10-2017, 06:27 AM
  7. [SOLVED] power query editor - unpivot?
    By pccamara in forum Excel General
    Replies: 5
    Last Post: 09-07-2016, 10:26 AM

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