Adding value to existing field

sj1601

Board Regular
Joined
Aug 12, 2006
Messages
96
I have a sheet with existing data columns. Some data fields already have the data code in the adjacent cell but some don't. I have to find which data fields don't have values adjacent to them and place them there. For instance

Col A Col B
JO John
Smith
MA Mary

and so on.
I need to find all the Smiths (and other such data points) in the column and add the code "SM" in col A next to it.

I have another table which has all the Johns, Smiths and Marys, etc and their corresponding codes which we can use to fill in the blanks in this column.

Any ideas?

If my query is not clear please feel free to ask questions.

Thanks.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
Let's assume your lookup table is in Sheet2!A1:B50

IF your lookup table is set like this: Code Name

Then the formula for A2 in the sheet witt the gaps will be
=INDEX(Sheet2!$A$1:$B$50,MATCH(B2,Sheet2!$A$1:$B$50,0))

If your lookup table is set like this: Name Code

This formula will do it:
=VLOOKUP(B2,Sheet2!$A$1:$B$50,2,FALSE)

Fill down

Denis
 

Forum statistics

Threads
1,136,925
Messages
5,678,602
Members
419,774
Latest member
MooseWinooski

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