简体   繁体   English

Excel:使用一个单元格中的数字在另一个单元格中写一个字符串

[英]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.

相关问题 是否存在一个可以将一个单元格中的一个字符串到另一个单元格中的所有蓝色字体数字求和的excel公式? - Is there an excel formula that I can use to sum all blue font numbers from a string in one cell to another? Excel VBA基于另一个字符串计算一个单元格 - Excel VBA calculate one cell based on string from another 有没有办法 output 从一个 excel 单元到另一个单元的字符串? - Is there a way to output a string from one excel cell to another? 从一个Excel到另一个Excel逐个单元复制值 - Copying value cell by cell from one excel to another excel 如何通过将一个特定单元格中的数据作为变量从一个 Excel 存储到另一个 Excel 中来写入数据 - How to Write Data from one particular cell by storing it as a variable from one Excel to Another Excel 从另一个单元格中的一个数字减去一个单元格中的数字范围的公式 - Formula for subtracting number range in one cell from a number in another cell 使用MS Excel将一个数字四舍五入为2个有效数字,然后更新另一个单元格以匹配小数位数 - Use MS Excel to round one number to 2 significant figures, then update another cell to match the number of decimal places 如果单元格包含Excel,则将其写入另一个 - Excel if cell contain then write it in another excel将从单元格1找到的字符串复制到新单元格 - excel copying string found from cell one to a new cell Excel VBA 从一个单元格中提取单元格地址,从另一个单元格中提取一个值,然后输入到另一个单元格中 - Excel VBA to pull a cell address from one cell, pull a value from another, and input into yet another cell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM