鉴于,
| A | B | C |
Row 1 |xxx | 121 | 21.1 |
在新的单个单元格中,如何编写生成的公式:
Some arbitrary text ...
The first column = xxx
The second column = 121
The third column = 21.1
部分说"一些任意文本,第一列,第二列,第三列"已经在细胞中了。我想做的就是定义一个类似于:
的公式Some arbitrary text ...
The first column = A1
The second column = B1
The third column = C1
答案 0 :(得分:2)
您可以使用CONCATENATE()函数
执行此操作=CONCATENATE("some arbitrary text",CHAR(10),"The first column = ",A1,CHAR(10),"The second column = ",B1,CHAR(10),"The third column = ",C1)
或没有CONCATENATE。
="some arbitrary text"&CHAR(10)&"The first column = "&A1&CHAR(10)&"The second column = "&B1&CHAR(10)&"The third column = "&C1
无论哪种方式,单元格的Wrap text
属性都必须设置为True(选中格式单元格对话框>>对齐标签)。
文本"第一栏="等等不能在细胞中。他们必须在公式中。但是,如果它们是可变的,您可以将它们放在隐藏它们的另一列或多列中,并通过引用将它们拉入您的公式。
答案 1 :(得分:0)
如果A12包含新的单行单元格,
Some arbitrary text ...
The first column =
The second column =
The third column =
B12:
=ARRAYFORMULA(SUBSTITUTE(JOIN(CHAR(10),TRANSPOSE(SPLIT(SUBSTITUTE(A12,CHAR(10), "", 1), CHAR(10))&A1:C1)),"", CHAR(10)))