跳到主要内容

如何在Excel中向数字或文本添加或填充前导零?

如果您有一个数字列表,需要在数字之前添加或填充一些前导零,那么在手动键入零时,默认情况下会删除它们。 本文将向您展示一些有关如何在Excel中的单元格范围内向数字或文本添加前导零的教程。

doc添加前导零1

方法1:使用文本功能将前导零添加或填充到等于一定长度的数字

方法2:使用格式单元格功能将前导零添加或填充到等于一定长度的数字

方法3:使用串联函数将数字添加或插入相同数量的前导零

方法4: 使用Kutools for Excel向数字和文本添加或插入相同数量的前导零


方法1:使用文本功能将前导零添加或填充到等于一定长度的数字

假设您具有一定范围的数据,并且需要在每个单元格前面添加零以使数字具有相同的长度。 您如何快速在数字之前添加零?

文本功能将在数字前面添加零,并在一定长度内使新数字以前导零开头。

输入公式 = TEXT(A4,“ 000000”) 在要输出结果的空白单元格中,然后将填充手柄向下拖动到要应用此公式的单元格上,所有数字将变为固定的六位数字符串,请参见屏幕截图:

doc添加前导零2

备注: 此文本功能无法为文本添加前导零。


方法2:使用格式单元格功能将前导零添加或填充到等于一定长度的数字

在Excel中, 单元格格式 该功能还可以帮助您将前导零填充到像元值以使其具有相同的长度,请执行以下操作:

1。 选择要填充前导零的单元格值,然后右键单击,然后选择 单元格格式 从上下文菜单。

2.单元格格式 对话框中的 联系电话 标签,选择 定制版 在左边 产品分类 窗格,然后输入 000000Type 文本框,(在此示例中,我将数字设置为六位数字,您可以根据需要进行更改。),请参见屏幕截图:

doc添加前导零3

3。 然后,点击 OK 关闭此对话框,并且原始单元格中的数字已转换为带有前导零的特定长度数字。 看截图:

doc添加前导零4


方法3:使用串联函数将数字添加或插入相同数量的前导零

如果要在每个数字中插入前导零的特定数字,例如,每个数字插入三个前导零,则应尝试使用 CONCATENATE 功能。

输入公式 = CONCATENATE(“ 000”,A4) 在空白单元格中,然后向下拖动填充手柄以将该公式填充到其他单元格中,并且所有数字在数字之前添加了三个零,请参见屏幕截图:

doc添加前导零5


方法 4: 方法4: 使用 Kutools for Excel 添加或插入相同数量的前导零到数字和文本

函数或公式可能不容易记住和应用。 这是另一种棘手的方法, 添加文本 实用程序 Kutools for Excel,以帮助您在选择中的数字前插入前导零。

Kutools for Excel : 带有300多个便捷的Excel加载项,可以在30天内免费试用. 

1。 选择要在数字或文本之前添加零的范围。

2。 然后点击 库工具 > 文本 > 添加文本,请参见屏幕截图:

3。 在 添加文本 对话框中,输入零,并在前面加上撇号 文本 框,然后选择 在第一个字符之前 选项,然后单击 Ok 按钮,并且在数字之前添加了零,如下图所示:

doc添加前导零7

点击下载Kutools for Excel并立即免费试用!

添加文本 实用程序 Kutools for Excel 支持我们在原始单元格文本之前或之后添加任何特定的文本和字符。 此外,我们可以在原始单元格文本之间添加特定的文本。 无论您设置哪种设置,都可以在“预览”部分中预览单元格的更改。 单击以了解有关此实用程序的更多信息.


使用 Kutools for Excel 添加前导零到数字或文本

Kutools for Excel 包括300多个便捷的Excel工具。 30天免费试用,不受限制。 立即下载免费试用版!

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (76)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Благодарю за материал 🙏
Rated 5 out of 5
This comment was minimized by the moderator on the site
Hola me pueden ayudar tengo una lista de datos cada dato contiene letras y números pero requiero ampliar su longitud a 12 con los ceros en la parte de enmedio conocen una formula que me ayude. Ejemplo: dato = DID45 expectativa = DID000000045
This comment was minimized by the moderator on the site
Hi Chelas,

Are there always three letters before two number characters?
If so, you can use the Add Text feature, and choose Specify option. And enter 3 in the input box to add 7 zeros after the 3rd character.https://www.extendoffice.com/images/stories/comments/ljy-picture/add-seven-zeros.png

Amanda
This comment was minimized by the moderator on the site
I got my already programmed and blank ATM card to withdraw the maximum of $100,000 MONTHLY for a maximum of 12 MONTHS. I am so happy about this because i got mine last week and I have used it to get $400,000 already. () is giving out the card just to help the poor and needy though it is illegal but it is something nice and he is not like other scam pretending to have the blank ATM cards. And no one gets caught when using the card. Get yours from THOMAS PERRY Hackerz today! Just send an email to ()
This comment was minimized by the moderator on the site
В примере ошибка, нужно ставить не запятую, а точку с запятой: "= Текст (A2, "00000")"
This comment was minimized by the moderator on the site
thank you, very helpful
This comment was minimized by the moderator on the site
I was wondering how i would write phone numbers in excel, but there was no zeros appearing. And also the phone numbers are in one column like

column D
This comment was minimized by the moderator on the site
Thank you for sharing..it's really use for me.
This comment was minimized by the moderator on the site
Thank you for helping me out. You saved my day!
This comment was minimized by the moderator on the site
Worked well for me. Thanks alot.
This comment was minimized by the moderator on the site
Hey, i was wondering how to put text in-front of a number with 0 decimal places. ie. it comes up as " Sp3.145255246345 " and i want it to show " Sp3" Thanks
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations