[英]How to define multiple text and formula in a cell?
鑒於,
| 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
您可以使用 CONCATENATE() 函數執行此操作
=CONCATENATE("some arbitrary text",CHAR(10),"The first column = ",A1,CHAR(10),"The second column = ",B1,CHAR(10),"The third column = ",C1)
或沒有連接。
="some arbitrary text"&CHAR(10)&"The first column = "&A1&CHAR(10)&"The second column = "&B1&CHAR(10)&"The third column = "&C1
無論哪種方式,單元格的Wrap text
屬性都必須設置為 True(檢查 Format Cells 對話框的 -> Alignment 選項卡)。
文本“First column =”等不能已經在單元格中。 它們必須在公式中。 但是,如果它們是可變的,您可能會將它們放在隱藏它們的另一列或多列中,並通過引用將它們拉入您的公式中。
如果 A12 包含新的單行單元格,
Some arbitrary text ...
The first column =
The second column =
The third column =
乙12:
=ARRAYFORMULA(SUBSTITUTE(JOIN(CHAR(10),TRANSPOSE(SPLIT(SUBSTITUTE(A12,CHAR(10), "👻", 1), CHAR(10))&A1:C1)),"👻", CHAR(10)))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.