拖动单元格,保持引用的递增顺序。

huangapple go评论76阅读模式
英文:

Drag cells keeping the reference in incremental order

问题

=CONCAT("她的名字是",A2)

=CONCAT("她的国家是",B2)

英文:

I have a table of a name and a country:

拖动单元格,保持引用的递增顺序。

I'm using concatenation, taking A2 and B2 as an example to output the following text in two rows

=CONCAT("Her name is ",A2)

=CONCAT("Her country is ",B2)

拖动单元格,保持引用的递增顺序。

Now I'm selecting the concatenation formulas of these two cells and drag them to the bottom so that this can be replicated with the other two names. But since the cocatanated strings of text are in two different cells, it doesn't do that. It jumps a value and doesn't reference the table values in incremental order. Any help would be appreciated.

Current incorrect output:

拖动单元格,保持引用的递增顺序。

答案1

得分: 2

Sure, here's the translated code part:

如果您使用的是 Microsoft-365,请尝试-

=TEXTSPLIT(TEXTJOIN("|",1,"Her name is " & A2:A4 & "|Her country is " & B2:B4),"|")

对于较旧版本的 Excel,可以尝试-

=INDEX({"Her name is ";"Her country is "},MOD(ROW(A2),2)+1) & INDEX($A$2:$B$4,ROUNDDOWN(ROW(A2)/2,0),MOD(ROW(A2),2)+1)

拖动单元格,保持引用的递增顺序。

英文:

If your are on Microsoft-365 then try-

=TEXTSPLIT(TEXTJOIN("|",1,"Her name is " & A2:A4 & "|Her country is " & B2:B4),,"|")

For older version of excels could try-

=INDEX({"Her name is ";"Her country is "},MOD(ROW(A2),2)+1) & INDEX($A$2:$B$4,ROUNDDOWN(ROW(A2)/2,0),MOD(ROW(A2),2)+1)

拖动单元格,保持引用的递增顺序。

答案2

得分: 1

这在Excel中正常工作。复制带有引用的单元格是相对于原始值的。你向下移两行,因为你的结果单元格是垂直排列的。

  • 将两个单元格水平放置。
  • 在数据行之间留出一行空白。如果不想看到它,可以隐藏它。
  • 可以创建简单的宏。
英文:

This works normal in Excel. Copying cells with references are relative to the original value. You move two lines down because your result cells are vertically arranged.
You can

  • Place the two cells horizontally.
  • Leave a blank row between your data rows. You can hide it if not want to see.
  • Can create simple macro.

答案3

得分: 0

我仔细查看了文本拆分/文本连接的解决方案,实际上比我最初想的更有用。甚至可以轻松添加另一行数据,以防将来需要。

英文:

I looked closer at the textsplit/textjoin solution and that's actually more useful than I first thought. It's easy to even add another row of data, in case this would become relevant in the future

huangapple
  • 本文由 发表于 2023年5月7日 11:46:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/76192114.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定