跳到主要內容

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

如果您有一個數字列表,需要在數字之前添加或填充一些前導零,那麼在手動鍵入零時,默認情況下會刪除它們。 本文將向您展示一些有關如何在Excel中的單元格範圍內向數字或文本添加前導零的教程。

doc添加前導零1

方法1:使用文本函數將前導零添加或填充到等於一定長度的數字

方法2:使用格式單元格功能將前導零添加或填充到等於一定長度的數字

方法3:使用連接功能將相同數量的前導零添加或插入到數字中

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


方法1:使用文本函數將前導零添加或填充到等於一定長度的數字

假設您具有一定範圍的數據,並且需要在每個單元格前面添加零以使數字具有相同的長度。 您如何快速在數字之前添加零?

文本功能將在數字前面添加零,並在一定長度內使新數字以前導零開頭。

輸入公式 = TEXT(A4,“ 000000”) 在要輸出結果的空白單元格中,然後將填充手柄向下拖動到要應用此公式的單元格中,所有數字將變為固定的六位數字符串,請參見屏幕截圖:

doc添加前導零2

備註: 此文本功能無法為文本添加前導零。


方法2:使用格式單元格功能將前導零添加或填充到等於一定長度的數字

在Excel中, 單元格格式 該功能還可以幫助您將前導零填充到像元值以使其具有相同的長度,請執行以下操作:

1。 選擇要填充前導零的單元格值,然後右鍵單擊,然後選擇 單元格格式 從上下文菜單。

2.單元格格式 對話框中的 聯繫電話 標籤,選擇 習俗 在左邊 類別 窗格,然後輸入 000000類別 文本框,(在此示例中,我將數字設置為六位數字,可以根據需要進行更改。),請參見屏幕截圖:

doc添加前導零3

3。 然後,點擊 OK 關閉此對話框,並且原始單元格中的數字已轉換為帶有前導零的特定長度數字。 看截圖:

doc添加前導零4


方法3:使用連接功能將相同數量的前導零添加或插入到數字中

如果您想在每個數字中插入前導零的特定數字,例如每個數字三個前導零,則應嘗試使用 CONCATENATE 的功能。

輸入公式 = CONCATENATE(“ 000”,A4) 在空白單元格中,然後向下拖動填充手柄以將該公式填充到其他單元格中,並且所有數字在數字之前添加了三個零,請參見屏幕截圖:

doc添加前導零5


方法4:方法4:使用Kutools for Excel在數字和文本中添加或插入相同數量的前導零

函數或公式可能不容易記住和應用。 這是另一種棘手的方法, 添加文本 的效用 Excel的Kutools,以幫助您在選擇中的數字前插入前導零。

Excel的Kutools : 帶有300多個便捷的Excel加載項,可以在30天內免費試用. 

1。 選擇要在數字或文本之前添加零的範圍。

2。 然後點擊 庫工具 > 文本 > 添加文本,請參見屏幕截圖:

3。 在 添加文本 對話框中,輸入零,並在前面加上撇號 文本 框,然後選擇 在第一個字符之前 選項,然後單擊 Ok 按鈕,並且在數字之前添加了零,如下圖所示:

doc添加前導零7

點擊下載Kutools for Excel並立即免費試用!

添加文本 的效用 Excel的Kutools 支持我們在原始單元格文本之前或之後添加任何特定的文本和字符。 此外,我們可以在原始單元格文本之間添加特定的文本。 無論您設置哪種設置,都可以在“預覽”部分中預覽單元格的更改。 單擊以了解有關此實用程序的更多信息.


使用Kutools for Excel在數字或文本中添加前導零

Excel的Kutools 包括300多個便捷的Excel工具。 30天免費試用,不受限制。 立即下載免費試用版!

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為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