Why Excel Adds a OneDrive URL to VLOOKUP Formulas
Question details
The user is asking why Microsoft Excel automatically inserts a long file path or a OneDrive/SharePoint URL into formulas (such as VLOOKUP) that reference another workbook.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Creating or viewing formulas that pull data from a separate, external workbook.
- Observed behavior
- When the referenced external workbook is closed, Excel alters the formula to display the complete local path, SharePoint URL, or OneDrive link instead of just the workbook name.
Ensure that both your working document and the external source workbook are properly saved to your desired local drive or cloud storage (OneDrive/SharePoint) before linking them.
Keep the Source Workbook Open to Shorten Formula Paths
Understand how Excel manages external references and learn how to keep formulas looking clean by keeping the source file open.
This is standard, intended behavior in Microsoft Excel. When you have both workbooks open, Excel has immediate access to the active file and only needs to display the workbook's name in brackets (e.g., '[Data.xlsx]Sheet1').
Once the referenced workbook is closed, Excel must store the absolute file path (such as a local drive letter or a full OneDrive/SharePoint URL). This guarantees that Excel knows exactly where to find and fetch the data the next time the workbook calculates. There is no supported way to permanently remove this path while the source file remains closed.
Navigate to the location of the external file (the one your VLOOKUP is pulling data from) and open it in Excel.
Open the workbook containing your VLOOKUP formulas.
Click on the cell with the formula. You will notice that the long OneDrive URL or file path has disappeared, leaving only the short file name.
Seamlessly Manage Spreadsheets with WPS Office
If you are looking for a reliable, free alternative to Microsoft Office, WPS Office offers a robust Spreadsheet application. It effortlessly handles external references, VLOOKUPs, and complex datasets while maintaining exceptional format compatibility.
- 1. Download and install: Download WPS Office for free from the official website and follow the simple installation instructions.
- 2. Open your Excel files: Launch WPS Spreadsheet, go to Menu > Open, and select your existing .xlsx files.
- 3. Work seamlessly: Instantly view, edit, and manage your data and formulas without worrying about compatibility issues.

Frequently Asked Questions
Can I stop Excel from adding the full path to my formulas?
No, you cannot permanently stop this behavior. Excel fundamentally requires the full local or OneDrive path to retrieve your data when the source workbook is closed. Without this path, Excel would lose the link reference.
Why does my VLOOKUP return a #REF! error after closing the source file?
This usually happens if the external source file was moved, renamed, or deleted after the formula was created, or if you do not have permissions to the SharePoint/OneDrive location. You can fix this by going to Data > Edit Links and updating the source path.
Does this path expansion happen with SharePoint files too?
Yes. If your source workbook is synced or hosted on SharePoint or OneDrive, Excel will convert the standard file name into the complete web URL (e.g., https://tenant.sharepoint.com/...) as soon as the file is closed.
How do I manage all external links in my workbook?
You can view and manage all external workbook references by navigating to the 'Data' tab on the Excel ribbon and clicking on 'Edit Links' (or 'Workbook Links' in newer versions). From there, you can update values, change the file source, or break the links entirely.




