跳到主要內容

如何在不擴展到Excel中的單元格的情況下返回文件名?

在Excel中,我們可以採用一些方法在特定的單元格(例如XLSX,XLSM)中插入帶有擴展名的工作簿名稱。 有時,您可能只想插入不帶擴展名的文件名,如何在Excel中處理此問題?

返回文件名,不帶公式擴展到單元格
使用出色的工具輕鬆獲取工作簿信息(工作表名稱,文件名/路徑等)

有關獲取工作簿信息的更多教程...


返回文件名,不帶公式擴展到單元格

以下公式可以幫助您快速獲取不包含擴展名的文件名,請執行以下步驟:

1.選擇一個空白單元格以輸出工作簿名稱。

2.輸入或複制以下公式,然後按 Enter 鍵以獲取文件名。

=MID(CELL("filename",A1),SEARCH("[",CELL("filename",A1))+1,SEARCH(".",CELL("filename",A1))-1-SEARCH("[",CELL("filename",A1)))

筆記:

  • 1.除上述公式外,您還可以使用以下公式:
    =TRIM(LEFT(SUBSTITUTE(MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,255),".xl",REPT(" ",255)),255))
  • 2.在上述公式中, A1 是變量,您可以將其更改為任何其他單元格引用。

使用出色的工具輕鬆獲取工作簿信息(工作表名稱,文件名/路徑等)

在本節中,我將介紹一個方便的工具- 插入工作簿信息 的效用 Excel的Kutools 為了你。 此功能可以幫助將工作簿信息(例如工作表名稱,工作簿名稱,所需的工作簿路徑)插入特定的單元格,頁眉或頁腳。

申請前 Excel的Kutools首先下載並安裝.

1.選擇一個單元格以輸出工作簿信息,單擊 Kutools 加 > 工作簿 > 插入工作簿信息。 見截圖:

2。 在裡面 插入工作簿信息 對話框中選擇一個工作簿信息 資訊 部分中,指定要在其中插入信息的位置 插入 at 部分,然後單擊 確定。

如下面的屏幕截圖所示,在單擊文件名後,文件名將插入A2中。 OK 按鈕。

  如果您想免費試用(30天)此實用程序, 請點擊下載,然後按照上述步驟進行操作。


相關文章

獲取並在Excel中插入最後修改的用戶名
本文將向您展示獲取上次修改的用戶名信息並將上次修改的用戶名信息插入Excel單元格的方法。

在Excel中將文件名插入頁眉/頁腳/單元格而不進行擴展名
通常,打開的工作簿的文件名和擴展名顯示在Excel窗口的頂部。 如果只需要在文件頭,頁腳或單元格中插入不帶擴展名的文件名。 怎麼解決呢? 本文將介紹完成它的方法。

將上次保存的時間戳插入Excel中的工作表單元格
在許多情況下,您可能需要顯示Excel工作簿的最後保存日期和時間,以便了解文件的最近更新時間。 嘗試本文中的方法。

將頁碼插入Excel中的單元格/頁眉/頁腳
打印Excel文件時,可能需要在頁中插入頁碼,以使打印的文件整潔可讀。 本教程介紹了一些快速技巧,可為您將頁碼插入單元格,頁眉或頁腳。

有關獲取工作簿信息的更多教程...

最佳辦公生產力工具

🤖 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 (11)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
FYI, it doesn't work if you only have one TAB. It was giving me an error, until I added a 2nd tab.
This comment was minimized by the moderator on the site
Thanks! But only this formula works: =TRIM(LEFT(SUBSTITUTE(MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,255),".xl",REPT(" ",255)),255)) WHILE =MID(CELL("filename",A1),SEARCH("[",CELL("filename",A1))+1,SEARCH(".",CELL("filename",A1))-1-SEARCH("[",CELL("filename",A1))) does not work!
This comment was minimized by the moderator on the site
Thanks a lot dear..........
This comment was minimized by the moderator on the site
Thank you so much. this formula very helpful for me.
This comment was minimized by the moderator on the site
thank you so much for putting this up. Made my work simple
This comment was minimized by the moderator on the site
That works well BUT on a Mac you have to replace every , by a ;
This comment was minimized by the moderator on the site
Just returns #VALUE!.... terrible instructions.
This comment was minimized by the moderator on the site
Hello!



The formula above seems inactive if converted into a .zip folder. Is there a way out?



Thank you!
This comment was minimized by the moderator on the site
this works well . thank you
This comment was minimized by the moderator on the site
I can't get this to work in an .xlsmfile. Any ideas on what to do in an .xlsm file?

Thanks!

Deb
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