# Transpose table

**URL:** <https://connect.superhuman.com/t/transpose-table/6113>\
**Category:** Ask the Community\
**Created:** [February 5, 2019, 2:32pm UTC](https://connect.superhuman.com/t/transpose-table/6113 "2019-02-05T14:32:18Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vlad\_Dumitrescu](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/vlad_dumitrescu/32/6009_2.png) [@Vlad\_Dumitrescu](https://connect.superhuman.com/u/Vlad_Dumitrescu)\
**Post date:** [February 5, 2019, 2:32pm UTC](https://connect.superhuman.com/t/transpose-table/6113/1 "2019-02-05T14:32:18Z")

</div>

I would need to display a table/view in a transposed way, with rows as columns. Is that possible?

---

<div class="post-metadata">

**Author:** ![Ander](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/ander/32/9134_2.png) [@Ander](https://connect.superhuman.com/u/Ander)\
**Post date:** [February 5, 2019, 3:02pm UTC](https://connect.superhuman.com/t/transpose-table/6113/2 "2019-02-05T15:02:41Z")

</div>

+1 on being able to toggle table axes for optimized human interaction with certain data sets.

---

<div class="post-metadata">

**Author:** ![Michael\_RnW](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/michael_rnw/32/5747_2.png) [@Michael\_RnW](https://connect.superhuman.com/u/Michael_RnW)\
**Post date:** [February 5, 2019, 3:02pm UTC](https://connect.superhuman.com/t/transpose-table/6113/3 "2019-02-05T15:02:41Z")

</div>

You can in a way.  
You can Display as Cards and Group Cards by the first Column on the Top side.  
It’s not a compact view but it can work in cases.

 ![image](https://global.discourse-cdn.com/coda1/original/2X/8/84d0a82120b8ebeaf011256bc9c6b18baa605eef.png)  
Hope this helps. 🙂

---

<div class="post-metadata">

**Author:** ![Vlad\_Dumitrescu](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/vlad_dumitrescu/32/6009_2.png) [@Vlad\_Dumitrescu](https://connect.superhuman.com/u/Vlad_Dumitrescu)\
**Post date:** [February 5, 2019, 3:19pm UTC](https://connect.superhuman.com/t/transpose-table/6113/4 "2019-02-05T15:19:42Z")

</div>

Good idea, but like you said, it’s just “kind of working”. Thanks!

---

<div class="post-metadata">

**Author:** ![Mufid\_Afif](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/mufid_afif/32/7369_2.png) [@Mufid\_Afif](https://connect.superhuman.com/u/Mufid_Afif)\
**Post date:** [April 10, 2019, 9:43pm UTC](https://connect.superhuman.com/t/transpose-table/6113/5 "2019-04-10T21:43:02Z")

</div>

Any other idea? It would be nice if we can make a formula refer by column-row.

---

<div class="post-metadata">

**Author:** ![Paul\_Danyliuk](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/paul_danyliuk/32/27228_2.png) [@Paul\_Danyliuk](https://connect.superhuman.com/u/Paul_Danyliuk)\
**Post date:** [April 11, 2019, 6:58pm UTC](https://connect.superhuman.com/t/transpose-table/6113/6 "2019-04-11T18:58:02Z")

</div>

A makeshift solution, but you can make a separate table that will look up data from your original table in a transposed way.

It will be read-only, and you’ll have to manually create row/column mappings.

Demo:  
https://coda.io/embed/9F_-lrPQ4W?viewMode=embedplay

What you need to do:

1. In the original table, introduce a formula column that will `List(…)` all the columns you want to be readable from your transposed table.
2. In the transposed table, make as many columns as there are rows in the original table, and to each of them assign a formula in the fashion:  
`Source.[Row as list].Nth(X).Nth(thisRow.RowId())`  
where `X` is the constant number of this column.

Note that using `RowId()` is fine unless you ever delete rows from your transposed table. If you delete rows you’ll lose continuity in row IDs and will need something else as an index (e.g., a column with explicitly set values, or a row index as implemented [here](https://connect.superhuman.com/t/referencing-the-cell-above/7358)).

---

<div class="post-metadata">

**Author:** ![Vlad\_Dumitrescu](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/vlad_dumitrescu/32/6009_2.png) [@Vlad\_Dumitrescu](https://connect.superhuman.com/u/Vlad_Dumitrescu)\
**Post date:** [April 11, 2019, 7:32pm UTC](https://connect.superhuman.com/t/transpose-table/6113/7 "2019-04-11T19:32:39Z")

</div>

Thank you, that is a good suggestion and it would work for me. I see an issue with it however, and that is that if I need to do it for several tables, it’s going to be tedious.

---

<div class="post-metadata">

**Author:** ![Geoff\_Strout](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/geoff_strout/32/8240_2.png) [@Geoff\_Strout](https://connect.superhuman.com/u/Geoff_Strout)\
**Post date:** [March 18, 2021, 8:36pm UTC](https://connect.superhuman.com/t/transpose-table/6113/8 "2021-03-18T20:36:16Z")

</div>

This Transpose problem is one that I’ve been wrestling with for awhile in the world of spreadsheets and just ran into it on Coda. I agree that this would be a really helpful function to include.

Since the [@superhumans](https://connect.superhuman.com/groups/superhumans) often mention that the Row in Coda is considered the smallest possible unit, it seems like that would make a Transpose function harder to accomplish than in a spreadsheet world. Following this more database-like row centric methodology, I am curious if there is a more database-friendly solution to this problem.

In Coda, is there any formula-based solution to take all items in Table 1 from a particular Column (across multiple Rows) and auto-populate those values as Column Headers in a new Table (Table 2), so that whenever another Row is added in Table 1, another Column will be created in Table 2 with a Column Header from the value of the Row in Table 1?

---

<div class="post-metadata">

**Author:** ![Christiaan\_Huizer](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/christiaan_huizer/32/28269_2.png) [@Christiaan\_Huizer](https://connect.superhuman.com/u/Christiaan_Huizer)\
**Post date:** [March 19, 2021, 8:59am UTC](https://connect.superhuman.com/t/transpose-table/6113/9 "2021-03-19T08:59:10Z")

</div>

@Geoff_Strout ,nope, this would be a nice to have, but does not exist (yet).

writing a transpose function based on hard coded columns in Coda is [possible](https://connect.superhuman.com/t/transpose-table/6113/6) but a bit of work.

best, Christiaan

---

<div class="post-metadata">

**Author:** ![Terry\_Stagg](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/terry_stagg/32/35217_2.png) [@Terry\_Stagg](https://connect.superhuman.com/u/Terry_Stagg)\
**Post date:** [April 28, 2022, 7:51pm UTC](https://connect.superhuman.com/t/transpose-table/6113/10 "2022-04-28T19:51:03Z")

</div>

I have been working on a similar project and this solution would work great for me. I have created the column (… List) but now on the transposed table, when I type source, it does not pull anything up in formulas. Am I missing something or is there another way it has to be done since its been updated?

---

<div class="post-metadata">

**Author:** ![Luke\_Pighetti](https://avatars.discourse-cdn.com/v4/letter/l/e79b87/32.png) [@Luke\_Pighetti](https://connect.superhuman.com/u/Luke_Pighetti)\
**Post date:** [April 30, 2022, 12:18pm UTC](https://connect.superhuman.com/t/transpose-table/6113/11 "2022-04-30T12:18:36Z")

</div>

Would like a context menu option to transform the table with a single transpose. Would just make it easier to take common excel spreadsheet data and get it into a format that works well with Coda

---

<div class="post-metadata">

**Author:** ![Rickard\_Abraham](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/rickard_abraham/32/35007_2.png) [@Rickard\_Abraham](https://connect.superhuman.com/u/Rickard_Abraham)\
**Post date:** [February 8, 2023, 9:16am UTC](https://connect.superhuman.com/t/transpose-table/6113/12 "2023-02-08T09:16:22Z")

</div>

I came up with a quick and dirty way to transpose any given table:

- Copy table (CTRL + C when table is highlighted)
- Paste into a TSV-tranposing website such as [this one](https://www.browserling.com/tools/tsv-transpose)
- Copy updated text
- Paste back into Coda

Coda handles copy and pasting of tables / columns / cells beautifully, I’d like to give them credit for that

---

<div class="post-metadata">

**Author:** ![Max\_OBrien](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/max_obrien/32/49285_2.png) [@Max\_OBrien](https://connect.superhuman.com/u/Max_OBrien)\
**Post date:** [March 30, 2023, 8:11pm UTC](https://connect.superhuman.com/t/transpose-table/6113/13 "2023-03-30T20:11:35Z")

</div>

![image](https://global.discourse-cdn.com/coda1/original/3X/3/b/3b6e3decdf216a994c98a8a0b096c6bac12beddc.jpeg)

Max

---

<div class="post-metadata">

**Author:** ![Scott\_Collier-Weir](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/scott_collier-weir/32/29677_2.png) [@Scott\_Collier-Weir](https://connect.superhuman.com/u/Scott_Collier-Weir)\
**Post date:** [March 31, 2023, 2:39am UTC](https://connect.superhuman.com/t/transpose-table/6113/14 "2023-03-31T02:39:04Z")

</div>

This is out of control. In the best way possible. I love it

---

<div class="post-metadata">

**Author:** ![Rickard\_Abraham](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/rickard_abraham/32/35007_2.png) [@Rickard\_Abraham](https://connect.superhuman.com/u/Rickard_Abraham)\
**Post date:** [March 31, 2023, 4:30am UTC](https://connect.superhuman.com/t/transpose-table/6113/15 "2023-03-31T04:30:38Z")

</div>

Nice, sweet approach! Also a perfect use case for the column formulas I proposed

> [@New formulas for columns](https://connect.superhuman.com/t/new-formulas-for-columns/38750):
>
> Goal Dynamically select a column from a table Issue The current possible approach forces you to repeat yourself into a coupled mess: Select Options Formula List("Population", "Area", "Density", "GDP", "Elevation", "Temp") Dynamic Column Formula Switch( [Select], "Population", thisRow.Population, "Area", thisRow.Area, "Density", thisRow.Density, "GDP", thisRow.GDP, "Elevation", thisRow.Elevation, "Temp", thisRow.Temp ) If you want to add a column you need to modify informati…

---

<div class="post-metadata">

**Author:** ![Max\_OBrien](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/max_obrien/32/49285_2.png) [@Max\_OBrien](https://connect.superhuman.com/u/Max_OBrien)\
**Post date:** [September 25, 2023, 10:03am UTC](https://connect.superhuman.com/t/transpose-table/6113/16 "2023-09-25T10:03:08Z")

</div>

![image](https://global.discourse-cdn.com/coda1/original/3X/3/1/31a46b55ad6cc86ad49bdb4ab59f2b1048c2d32c.png)

Once again I needed a formula to display a TABLE in a TRANSPOSED format (ie swap rows and cols)

And I found an even SIMPLER solution…

- build a 2d matrix (list of lists) of the table columns
- loop through each column with foreach()
- loop through each of the col’s cells with foreach()
- pad out the cell to a fixed size using rightpad()
- use a fixed-width font using \_code()
- split the result into rows using bullededlist()

---

<div class="post-metadata">

**Author:** ![Amir\_Banihashemi](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/amir_banihashemi/32/24037_2.png) [@Amir\_Banihashemi](https://connect.superhuman.com/u/Amir_Banihashemi)\
**Post date:** [January 5, 2024, 6:33pm UTC](https://connect.superhuman.com/t/transpose-table/6113/17 "2024-01-05T18:33:56Z")

</div>

This is a cool solution! Is there a way to reference the transposed row? I have a doc which contains a profit and loss report with one column containing accounts and the others are a series of dates. I’d like to transpose it so that I can reference the rows in other formulas else where.
