Fix Excel CELL Filename Formula Returning a Cloud URL
Question details
The user needs to retrieve the local file system path using the CELL formula in Excel, but it currently returns an HTTP cloud path.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Using the =CELL("filename") formula on a workbook that is stored in a cloud-synchronized location such as OneDrive or SharePoint.
- Observed behavior
- The formula evaluates and returns a cloud URL (HTTP/HTTPS) representing the network location rather than the local synchronized folder path on the computer.
Ensure you know where your local OneDrive folder is located and be prepared to move your workbook outside of the synchronized directory if a local path is strictly required.
Use a Controlled Local Unsynchronized Folder
Move or save a copy of your Excel workbook to a strictly local folder that is not managed by OneDrive or SharePoint to force Excel to report the local directory path.
Excel prioritizes the cloud location as the master path for files stored in synchronized directories. Since Excel has no reliable built-in formula to translate a cloud URL back to a local path, the most dependable solution is to work from an unsynchronized local directory.
With your workbook open in Excel, go to the 'File' menu and select 'Save As'.
Click 'Browse' and navigate to a completely local folder on your computer, such as 'C:\LocalExcelFiles\', ensuring it is outside of the OneDrive hierarchy.
Save the workbook. Select the cell with your =CELL("filename") formula, press F2, and press Enter to recalculate. The formula will now display the local file path.

Temporarily Pause OneDrive Synchronization
Pause your cloud synchronization before opening the file. This can sometimes force Excel to fall back to the local cached path, although it is not consistently dependable.
Manage Spreadsheets Predictably with WPS Office
If Excel's forced OneDrive integration and cloud URLs are disrupting your workflow, consider using WPS Office. It provides an excellent, lightweight alternative that handles local file paths predictably without forcing cloud-based URL overrides.
- 1. Download WPS Office: Visit the official WPS website and download the free installation package.
- 2. Install the software: Run the installer and follow the on-screen instructions to set up WPS Office on your computer.
- 3. Open your spreadsheet: Launch WPS Spreadsheet and open your existing .xlsx file to continue working with reliable local path behaviors.

Frequently Asked Questions
Is there a built-in Excel function to convert the OneDrive URL to a local path?
No, Excel does not have a native formula to reliably convert a SharePoint or OneDrive HTTP URL back into a local file-system path.
Why does CELL("filename") show a cloud URL instead of C:\?
When AutoSave is enabled or the file resides in a cloud-synced folder, Excel prioritizes the cloud path as the primary master location for the file, returning the URL instead of the local cache path to facilitate collaboration.
Can I use VBA to get the local path instead?
Using VBA's ThisWorkbook.Path will often still return the URL for OneDrive files. To get the local path via VBA, you typically need to write custom parsing scripts to map the cloud URL to your local environment variables, which can be highly complex.




