如何将表转换为使用Row&的列表;列标题

发布于 2025-02-13 07:42:39 字数 414 浏览 3 评论 0 原文

Excel或Google Spreed表格是否可以将表转换为这样的列表?

在此表中:

“

到此列表:

Is there formala in excel or google spreed sheet can convert a table to a list like this?

from this table:

Table

to this list:

List

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

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

发布评论

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

评论(3

命硬 2025-02-20 07:42:39

您可以根据您的 excel版本 尝试以下任何一种方法。


•如果您正在使用 Excel 2010/2013/2016/2019/2021/MS365 ,那么,此方法适用于

单元 a6

=INDEX($A$2:$A$4,INT((ROW()-6)/COLUMNS($B$1:$D$1))+1)

在单元格中使用的公式

=INDEX($B$1:$D$1,MOD((ROW()-6),ROWS($A$2:$A$4))+1)

中 使用的所有公式 c6

=INDEX($B$2:$D$4,MATCH(A6,$A$2:$A$4,0),MATCH(B6,$B$1:$D$1,0))

注意:您可能需要更改(row() - 6)取决于 row> row()从你的地方正在进入转换公式。例如,就像您从单元格或第3行开始一样,它将是(Row(Row() - 3),因此按照您的西装相应地。


•如果您使用的是 MS365 ,并且在写作时,如果启用了 Office Insiders Beta Channel版本,则使用 lambda() hstack () textsplit() drop() take> take() tocol()& textjoin()也可以实现它。

=LAMBDA(array,
HSTACK(TEXTSPLIT(TEXTJOIN(".",1,
DROP(TAKE(array,,1)&"-"&TAKE(array,1),1,1)),"-","."),
TOCOL(DROP(array,1,1))))(A1:D4)

也要注意:您可以使用 custom 可重复使用 公式em> 友好名称 通过将上述公式放置在名称管理器 - 带有 定义名称 unpivot >。

因此,从公式选项卡中,单击定义名称 - >输入名称为 undivot ,并将上述公式如中的内容所指,请参考

=LAMBDA(array,
HSTACK(TEXTSPLIT(TEXTJOIN(".",1,
DROP(TAKE(array,,1)&"-"&TAKE(array,1),1,1)),"-","."),
TOCOL(DROP(array,1,1))))

语法是

=UNPIVOT(array)

数组为 a1:d4


关闭注: 您也可以使用 Power查询来实现上述转换

You may try any one of the following approaches, as per your Excel version.

FORMULA_SOLUTION


• If you are using Excel 2010/2013/2016/2019/2021/MS365, then this one works for all

Formula used in cell A6

=INDEX($A$2:$A$4,INT((ROW()-6)/COLUMNS($B$1:$D$1))+1)

Formula used in cell B6

=INDEX($B$1:$D$1,MOD((ROW()-6),ROWS($A$2:$A$4))+1)

Formula used in cell C6

=INDEX($B$2:$D$4,MATCH(A6,$A$2:$A$4,0),MATCH(B6,$B$1:$D$1,0))

Note: You may need to change the (ROW()-6) depending on the ROW() from where you are entering the formula for transformation. Example, like if you start from cell or row 3 then it will be (ROW()-3) so on so forth accordingly as per your suit.


• If you are using MS365 and when writing if you have enabled the Office Insiders Beta Channel Version then, using LAMBDA() HSTACK() TEXTSPLIT() DROP() TAKE() TOCOL() & TEXTJOIN() can achieve it as well.

=LAMBDA(array,
HSTACK(TEXTSPLIT(TEXTJOIN(".",1,
DROP(TAKE(array,,1)&"-"&TAKE(array,1),1,1)),"-","."),
TOCOL(DROP(array,1,1))))(A1:D4)

Also Note : You can use a custom, reusable formula with a friendly name by placing the above formula in the Name Manager - with Define Name as UNPIVOT.

So from Formulas tab, Click on Define Name --> Enter the name as UNPIVOT and place the above formula as in refers to

=LAMBDA(array,
HSTACK(TEXTSPLIT(TEXTJOIN(".",1,
DROP(TAKE(array,,1)&"-"&TAKE(array,1),1,1)),"-","."),
TOCOL(DROP(array,1,1))))

The syntax is

=UNPIVOT(array)

Where array is A1:D4


Closing Note: You can also achieve the above transformation using Power Query as well.

可可 2025-02-20 07:42:39

我在这里缺少一些东西。对于3x3阵列,两个用于B列工作的公式。但是,如果我将其更改为4x6数组,则在前四个值之后,B列找到的值开始。我正在使用的公式为:

= index($ b $ 1:$ g $ 1,mod((Row(Row() - 5-Quortient(Row(Row()-1,Counta($ B $ 1:$ G $ 1))) *counta($ b $ 1:$ g $ 1)),行($ a $ 2:$ a $ 5))+1)

好的,回答我的问题,这个公式似乎是工作:

=INDEX($B$1:$G$1,MOD(ROW()-7,COLUMNS($B$1:$G$1))+1)

I'm missing something here. For a 3x3 array, both formulas for column B work. But if I change it to a 4x6 array, the values found for column B start over after the first four values. The formula I'm using is:

=INDEX($B$1:$G$1,MOD((ROW()-5-QUOTIENT(ROW()-1,COUNTA($B$1:$G$1))*COUNTA($B$1:$G$1)),ROWS($A$2:$A$5))+1)

Formula example for both 3x3 and 4x6 arrays

OK, to answer my question, this formula seems to work:

=INDEX($B$1:$G$1,MOD(ROW()-7,COLUMNS($B$1:$G$1))+1)

Corrected Formula Example

旧情勿念 2025-02-20 07:42:39

这是一件很棒的Excel工程!由于示例是一个3x3阵列,因此在单元B6的公式中存在一个小错误。因此,它在此示例中没有注意到,但是当您的数组为NXM时,它将弹出为#REF!列B中的错误。

正确公式应为:

= index($ b $ 1:$ d $ 1,mod((Row(Row()-6-六Quotient(Row(Row()-1; Counta)($ B $ 1:$ d $ D $ 1 )*counta($ b $ 1:$ d $ 1)),行($ a $ 2:$ a $ 4))+1)

This is a great piece of Excel engineering! There is a small mistake in the formula of cell B6 due to the fact that the example is a 3x3 array. As such, it goes unnoticed in this example, but when your array is NxM it will pop up as #REF! error in column B.

Correct formula should be:

=INDEX($B$1:$D$1,MOD((ROW()-6-QUOTIENT(ROW()-1;COUNTA($B$1:$D$1))*COUNTA($B$1:$D$1)),ROWS($A$2:$A$4))+1)

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