[英]Excel: Use number from one cell to write a string in another cell
I have one column in excel with numbers. 我在Excel中有一栏是数字。 I need to use that number to write a string in another cell.
我需要使用该数字在另一个单元格中写入字符串。 For example, Column A has "21" , in column BI need to write a string of 21 0's.
例如,列A具有“ 21”,在列BI中需要写入21 0的字符串。 Then there should be periods so the total number of characters=40.
然后应该有句号,因此字符总数= 40。
Duration ch
21 000000000000000000000..................
22 0000000000000000000000.................
19 0000000000000000000....................
21 000000000000000000000..................
You can use the REPT()
formula to do this: 您可以使用
REPT()
公式执行此操作:
Assuming your first Duration
is in Cell A1
假设您的第一个
Duration
在单元格A1
=REPT("0", A1) & REPT(".", 40-A1)
This will repeat "0" as many times as the number in A1
and then will concatenate repeated "." 这将重复“ 0”与
A1
的数字相同的次数,然后将重复的“”连接起来。 until you have 40 characters. 直到您有40个字符。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.