Sometimes you may have a list of URLs and you need to extract only the file name. In the following way, you can extract the file name from a URL. Assume cell A4 contains this URL: http://example.com/assets/images/horse.jpg
The following formula returns horse.jpg from the above URL:
To understand this formula you have to know these four functions of Excel: RIGHT(), LEN(), FIND(), and SUBSTITUTE().
To make understand this process easier, we have broken the formula in different parts.
This formula returns actually all text that follows the last slash character. If cell A4 doesn’t contain a slash character, the formula will return an error.
To extract the URL without the file name, use this formula:
Happy Excelling 🙂