将标题值和/或分隔线连接到Google表中订购值的变量(1B)

发布于 2025-02-10 06:39:50 字数 1553 浏览 2 评论 0原文

在此共享中按指定顺序进行了联系,如何在指定2个变量时维护指定的订单: a)何时将“标题值”和“单元格值”组合到标题/值对,以及 b)当添加定界符时,

显示标头/值对以以下等式显示:

    =ARRAYFORMULA(TRIM(SUBSTITUTE(TRIM(FLATTEN(QUERY(REGEXREPLACE(SORT(TRANSPOSE(
 IF((A2:D4<>"")*(REGEXMATCH(A1:D1, "^\d+_")), "♥"&A1:D1&" "&A2:D4, )), 
 FLATTEN(A1:D1), 1), "\d+_", ),,9^9))), "♥", CHAR(10)))

“在此处输入图像说明”

所有带有上一个数字的标头值都按顺序显示在上图中。

目标 但是,如下图所示,有时不

  1. 包括标头值
  1. 添加一个或多个可变分配器(即char(10),“,”之后字符串和其他时间有助于

”“在此处输入图像说明”

可能的方法:

  1. 在上面的图像中,数字 + undercore ex 1_name( b1)可以代表一个参数,包括标题/值对和数字 + tilda 4〜MATH(A1)可以代表一个参数,以排除标题值

  2. 零或更多可划分器变量(&gt; 1由>&amp;表示),可以在管道后指定定界器以包含结果字符串, (值或标题/变量对)

因为上述方程式,我相信,我相信在管道后指定值以表示可分配者变量是有意义的。如下图所示,此参数将插入该空间中的公式。

例如,在B1中,管道char(10)&amp; char(10)会添加两个线路。在A1中,管道“”,之后的值只需添加一个没有新线路空间的逗号。

共享的表为

In this shared Google Sheet there are values in a range, contactenated in a specified order, how can I maintain the specified order while specifying 2 variables:
A) when to combine the "header value" and "cell value" into a header/value pair and
B) when to add a delimiter

A header/value pair are displayed with the following equation:

    =ARRAYFORMULA(TRIM(SUBSTITUTE(TRIM(FLATTEN(QUERY(REGEXREPLACE(SORT(TRANSPOSE(
 IF((A2:D4<>"")*(REGEXMATCH(A1:D1, "^\d+_")), "♥"&A1:D1&" "&A2:D4, )), 
 FLATTEN(A1:D1), 1), "\d+_", ),,9^9))), "♥", CHAR(10)))

enter image description here

All header values with a preceding number are displayed in order in the above image.

Goals
However, as in the following image, there are times when it would be useful to

  1. Not to include the header value
  1. add one or more variable delimeters (ie CHAR(10), " , " after the cell value string and other times when it would help to

enter image description here

Possible approach:

  1. In the above image, a number + an underscore ex 1_Name (B1 )can represent a parameter to include the header/value pair and a number + tilda 4~Math (A1) can represent a parameter to exclude the header value

  2. Zero or more delimeter variables (>1 represented by &)can be provided after a pipe to designate the delimiters to include afer the resulting string (value or header/variable pair)

Since the above equation, already adds a CHAR(10) delimiter I believe it would make sense to specify values after a pipe to represent a delimeter variable. As in the image below, this parameter would be inserted into the formula in that space.

enter image description here

For example, in B1 the value after the pipe CHAR(10) & CHAR(10) would add two line spaces. In A1, the value after the pipe ", " would simply add a comma without a new line space.

The shared sheet is here.

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

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

发布评论

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

评论(1

睫毛上残留的泪 2025-02-17 06:39:50

管道|之后的第1行中的内容只能作为纯文本访问而不是公式输入。因此,最好没有双引号的逗号,而不是char(10)&amp; char(10)使用唯一的符号两次,例如♦♦

请参阅图像以获取黄色突出显示的建议更改:

=INDEX(SUBSTITUTE(REGEXREPLACE(SUBSTITUTE(TRIM(FLATTEN(QUERY(REGEXREPLACE(SORT(TRANSPOSE(
 TRIM(IF((A2:D4<>"")*((REGEXMATCH(A1:D1, "^\d+_"))+(REGEXMATCH(A1:D1, "^\d+~"))), 
 IFNA(REGEXEXTRACT(A1:D1, "\d+_(.*:)"))&" "&A2:D4®EXEXTRACT(A1:D1, "\|(.*)"), ))), 
 FLATTEN(A1:D1), 1), "\d+_", ),,9^9))), "♦ ", "♦"), ",$", ), "♦", CHAR(10)))

stuff in your row 1 after pipe | can be accessed only as plain text and not as formula input. therefore it's better to have , commas without double-quotes and instead of CHAR(10) & CHAR(10) use a unique symbol twice like ♦♦:

see the image for recommended changes highlighted by yellow:

enter image description here

=INDEX(SUBSTITUTE(REGEXREPLACE(SUBSTITUTE(TRIM(FLATTEN(QUERY(REGEXREPLACE(SORT(TRANSPOSE(
 TRIM(IF((A2:D4<>"")*((REGEXMATCH(A1:D1, "^\d+_"))+(REGEXMATCH(A1:D1, "^\d+~"))), 
 IFNA(REGEXEXTRACT(A1:D1, "\d+_(.*:)"))&" "&A2:D4®EXEXTRACT(A1:D1, "\|(.*)"), ))), 
 FLATTEN(A1:D1), 1), "\d+_", ),,9^9))), "♦ ", "♦"), ",
quot;, ), "♦", CHAR(10)))
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文