replacing cell contents with another value

smithrd6

Board Regular
Joined
Dec 13, 2005
Messages
150
I have a spreadsheet with column contents containing the Product code listed below. I need to replace those codes with the actual Product Supplier Name listed below which is not contained on this spreadsheet report. Those names are contained on another worksheet. Is there a formula which can do this?




Product Code
011024
011025
011026

Product Supplier
Maco
Dupont
Walgreens

thanks
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
If you have the Product Code on the other sheet you can use VLOOKUP ( or INDEX/MATCH depending on where it is).

There's a good example here: www.contextures.com

Otherwise you'll probably be stuck with Find & Replace.

HTH,

Smitty
 
Upvote 0

HalfAce

MrExcel MVP
Joined
Apr 6, 2003
Messages
9,456
Here’s one way, using the vlookup function. (I imagine it could be done using index & match too but this is the first thing that came to mind.)

First, on the ‘other sheet’ that contains the Product Suppliers, (in this example, Sheet2), insert a new column to the left of the suppliers’ names. (ie., the suppliers become column B with a new blank column A.)
Next, copy the list of Product Codes into the blank column A, (obviously, making sure each code is represented by its proper supplier in the next column.)
Now you can go back to the sheet containing your original list of product codes and (insert a new column to the right of this list if needed) and (say the codes are in column A, starting in row 2), in B2, enter the formula: =VLOOKUP(A2,Sheet2!$A$1:$B$4,2,0)
(In the formula, change the range “A1:B4” to the real range your data in sheet2 occupies.)
Then you can copy this formula down as far as your product codes go.
You can then delete the Sheet1 column A (product codes) if you like, just remember to Copy & PasteSpecial (as Values) the formulas in column B first.

[EDIT:]
As usual, work getting in the way of fun (and a timely response).
 
Upvote 0

Forum statistics

Threads
1,191,359
Messages
5,986,193
Members
440,010
Latest member
cdotshel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top