logo
search
Data Import & Export

How to Replace Product Names with EAN Codes in Excel Photo URLs

Olivia MillerOlivia Miller Oct 1, 2026 868 views

Question details

The user needs to dynamically replace product names embedded within photo URL strings with their corresponding EAN codes in an Excel spreadsheet.

How to Replace Product Names with EAN Codes in Excel Photo URLs
Product
Microsoft Excel
Device & OS
not provided
Scenario
Managing product image links where the downloaded filename needs to match the EAN code instead of the product name for bulk downloading and accurate file naming.
Observed behavior
The current photo URLs contain product names, and the user needs to update the URL text strings to contain the EAN codes instead, requiring a bulk text replacement method.
Before you start

Ensure your EAN codes and product names are organized in separate columns without any leading or trailing spaces. It is highly recommended to duplicate your original URL column before applying formulas to prevent accidental data loss.

Solution 1Recommended

Use the SUBSTITUTE Function to Replace Text Dynamically

The most efficient way to replace a specific substring (product name) with another (EAN code) inside a URL string is by using Excel's built-in SUBSTITUTE function.

This method is ideal if your worksheet is structured with EAN codes, product names, and URLs in consistent columns. It allows for dynamic updates, meaning if an EAN code changes, the URL will automatically update.

1
Identify your data columns

Verify the locations of your data. For example, assume Column A contains EAN Codes, Column B contains Product Names, and Column C contains the Photo URLs.

2
Enter the SUBSTITUTE formula

Click on an empty cell in a new column (e.g., cell D2) and type the formula: =SUBSTITUTE(C2, B2, A2). This tells Excel to look at the URL in C2, find the product name from B2, and replace it with the EAN code from A2.

3
Apply the formula to all rows

Press Enter to generate the new URL. Click on cell D2, grab the small square at the bottom-right corner of the cell (the fill handle), and drag it down to apply the formula to the rest of your list.

Use the SUBSTITUTE Function to Replace Text Dynamically
Formula Tip: The SUBSTITUTE function is case-sensitive. Ensure the product names in your reference column perfectly match the capitalization used in the URLs for the replacement to work.
Manage Excel Data Easily

Easily Manage Formulas and URLs with WPS Office

WPS Spreadsheet provides seamless compatibility with Excel formulas like SUBSTITUTE, making bulk text replacement in URLs fast and straightforward. It's a free, lightweight solution for all your data management needs.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your product URLs and EAN codes.
  2. 2. Insert the replacement formula: Type =SUBSTITUTE( in an empty cell next to your original URL.
  3. 3. Select your cell references: Click the URL cell, type a comma, click the product name cell, type a comma, and finally click the EAN code cell. Press Enter.
  4. 4. Autofill your entire list: Double-click the fill handle in the bottom-right corner of the formula cell to instantly replace product names across thousands of rows.
Fully compatible with Microsoft Excel formulas and file formatsFree and lightweight alternative to heavy office suitesBulk process URLs and EAN codes effortlesslyClean, intuitive interface for data formatting and management
microsoft office alternative - wps office

Frequently Asked Questions

Why isn't the SUBSTITUTE function replacing the product names in my URLs?

The SUBSTITUTE function is case-sensitive. If the product name in your reference cell is 'Apple' but the URL contains 'apple', it will not be replaced. Ensure the casing matches, or use upper/lower functions to standardize the text before replacing.

Can I remove special characters from product names before replacing them in URLs?

Yes. You can nest multiple SUBSTITUTE functions to clean up product names by stripping out hyphens or spaces (e.g., replacing spaces with hyphens if the URL uses hyphens) before running the final replacement against the URL.

How do I handle file extensions when replacing names with EAN codes?

If the product name being replaced doesn't include the file extension (like .jpg or .png), the extension will remain untouched at the end of the URL. If the file extension is accidentally overwritten, simply append &'.jpg' to the end of your formula.

How do I download these images using the newly generated EAN filenames?

Excel itself does not natively download images directly from URLs in bulk. Once your URLs are updated with the EAN codes, you will need to use a VBA macro or a third-party bulk image downloader tool, feeding it your newly generated list of URLs.