切换值和标题

发布于 2025-01-27 06:49:07 字数 644 浏览 1 评论 0原文

我有一个带有表格的Google表格,

card1 | card2 | card3 | card4 | card5 | card6 | card7 
------+-------+-------+-------+-------+-------+------
set3  | set1  | set1  | set2  | set2  | set4  | set1 
set4  | set2  | set3  | set3  | set4  |       | set2
      | set4  |       |       |       |       | set3
      |       |       |       |       |       | set4

如何切换表中的值以及标题中的值以产生这样的表:

 set1 |  set2 |  set3 |  set4 
------+-------+-------+-------
card2 | card2 | card1 | card1 
card5 | card4 | card3 | card2
      | card5 | card4 | card5  
      | card7 | card7 | card6 
      |       |       | card7

I have a google sheet with a table

card1 | card2 | card3 | card4 | card5 | card6 | card7 
------+-------+-------+-------+-------+-------+------
set3  | set1  | set1  | set2  | set2  | set4  | set1 
set4  | set2  | set3  | set3  | set4  |       | set2
      | set4  |       |       |       |       | set3
      |       |       |       |       |       | set4

How can I switch the values in the table and the values in the header to produce a table like this:

 set1 |  set2 |  set3 |  set4 
------+-------+-------+-------
card2 | card2 | card1 | card1 
card5 | card4 | card3 | card2
      | card5 | card4 | card5  
      | card7 | card7 | card6 
      |       |       | card7

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鸠魁 2025-02-03 06:49:07

使用:

=ARRAYFORMULA(TRIM(TRANSPOSE(SPLIT(FLATTEN(QUERY(QUERY(SPLIT(FLATTEN(
 IF(A2:G30="",,A2:G30&"¤×"&A1:G1&"¤")), "×"), 
 "select max(Col2) where Col2 is not null group by Col2 pivot Col1"),,9^9)), "¤"))))

use:

=ARRAYFORMULA(TRIM(TRANSPOSE(SPLIT(FLATTEN(QUERY(QUERY(SPLIT(FLATTEN(
 IF(A2:G30="",,A2:G30&"¤×"&A1:G1&"¤")), "×"), 
 "select max(Col2) where Col2 is not null group by Col2 pivot Col1"),,9^9)), "¤"))))

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文