0

I've read the suggested results pertaining to un-pivoting a table using the method from a Jon Walkenbach article, but I'm on a Mac, and can't get the desired result.

My scenario is exactly the same as found in the article: Transform horizontal table layout to vertical table so I'll just refer to those same field names and procedure steps here.

Since I don't have access to an "old pivot table menu" in macOS (as far as I know), I don't have the same options listed there. When I try to use the tools at my disposal, I get Field Names corresponding to ID, Name1, Name2, Name3, with a checkbox for each, rather than the desired Row, Column, Value.

If I uncheck everything but ID, I do get a single-cell pivot table, but double-clicking on that cell produces the exact same table that I started out with.

I was able to obtain the desired results using Excel on Windows 10 to test it and make sure I was understanding it correctly. But trying the same steps on the Mac, I can't get it to work. One answer might be "Use a PC." But if there's another answer, I'd love it. Thanks.

1
  • Interesting find. I suspect the Pivot Wizard has long since been updated and that process in your link no longer works. If power query is available to you in Mac-Excel there is an unpivot function. I have to check if lambda functions are available for Mac-Excel, but the formula I came up with was a little long if I remember correctly.
    – gns100
    Commented Sep 7, 2023 at 22:27

1 Answer 1

1

Assuming you have 365, you can use a formula (and, according to the documentation, the functions I am using are available in 365 MAC)

I used a table named Table5 and copied it from the example you linked to, but you could use regular addressing if you had to.

Also, as in that example, I assumed you wanted a two column result, with the first column being repeated:

=LET(
    cols, COLUMNS(Table5) - 1,
    rows, ROWS(Table5),
    v, TOCOL(DROP(Table5, , 1)),
    ID, INDEX(
        Table5[ID],
        INT((SEQUENCE(rows * cols) - 1) / cols + 1)
    ),
    stack, VSTACK({"ID", "Name"}, HSTACK(ID, v)),
    FILTER(stack, CHOOSECOLS(stack, 2) <> "")
)

In the above:

  • cols: number of columns to unpivot (total columns in table -1)
  • rows: number of data rows
  • v: a vertical array of the unpivoted columns
  • ID: a vertical array of the ID column (column1) with each entry repeated by the number of rows we are unpivoting
  • stack: the column headers and the two vertical columns are stacked into a result table
  • That result is then filtered to remove the blank entries

Data
enter image description here

Unpivoted
enter image description here

If you do not have those functions, you can use Power Query and you can access the unpivot function from the GUI.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .