Skip to main content

Find and replace multiple values in Excel

Normally, the Find and Replace feature can help you to find a specific text and replace it with another one, but, sometimes, you may need to find and replace multiple values simultaneously. For example, to replace all “Excel” text to “Excel 2019”, “Outlook” to “Outlook2019” and so on as below screenshot shown. This article, I will introduce a formula for solving this task in Excel.


Find and replace multiple values in Excel

To deal with this job, you should nest multiple SUBSTITUTE functions together, and insert the find and replace pairs using the INDEX function. The generic syntax is:

=SUBSTITUTE(SUBSTITUTE(cell,INDEX(find,1),INDEX(replace,1)),INDEX(find,2),INDEX(replace,2))
  • cell: The cell contains the text that you want to replace with other text.
  • find: The original text that you want to find and replace.
  • replace: The new text that you want to replace with.

1. Please copy and paste the following formula into a blank cell where you want to put the result:

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,INDEX($D$2:$D$5,1),INDEX($E$2:$E$5,1)),INDEX($D$2:$D$5,2),INDEX($E$2:$E$5,2)),INDEX($D$2:$D$5,3),INDEX($E$2:$E$5,3)),INDEX($D$2:$D$5,4),INDEX($E$2:$E$5,4))

2. Then drag the fill handle down to the cells that you want to apply this formula, and the specific texts have been replaced with the new ones at once, see screenshot:


Explanation of the formula:

The basic pattern of the above formula is the usage of the SUBSTITUTE function:

=SUBSTITUTE (text, old_text, new_text, [instance])

Then embed the INDEX function into the SUBSTITUTE function, the INDEX function is used to retrieve both the "find" text and the "replace" text, this will run the first pair of the find and replace:

=SUBSTITUTE(text,INDEX(find,1),INDEX(replace,1))

If there are multiple pairs of the find and replace, please nest the SUBSTITUTE functions together, for making the formula read and write easier to add or remove other substitutions, you can write the formula as below screenshot shown:


Note: In the above formula, A2 is the cell contains the text that you want to replace, D2:D5 is the range of cells contains the original text that you want to find and replace, E2:E5 is the new text that you want to replace with. And 1, 2, 3, 4 is the number of the pair of find and replace. Please change them to your need.


Relative functions used:

  • SUBSTITUTE:
  • The SUBSTITUTE function replaces text or characters within a text string with another text or characters.
  • INDEX:
  • The INDEX function returns the displayed value based on a given position from a range or an array.

The Best Office Productivity Tools


Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
Comments (2)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
那如果有100組資料要替換 Index公式要寫到100組嗎?!
This comment was minimized by the moderator on the site
如果數據很多的話,可以查看下面的文章,裡面VBA代碼可以幫助到你。
https://www.extendoffice.com/documents/excel/1873-excel-find-and-replace-multiple-values-at-once.html
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations