Modify an unknown range of cells

timmy2uk

New Member
Joined
Jul 25, 2007
Messages
12
hey all, been trying this for a while...i have a list of countries in a column and have to go through this column ensuring they are in the correct format. I'm struggling to figure out how to iterate through each row of the column, test it's value and then change if necessary...

for example
column a --> column A(modified)
Usa --> USA
Ukraine - Mobile (Umc) --> Ukraine - Mobile (UMC)
Uk --> UK
Uruguay --> Uruguay

so values in column a becomes like those shown above. any help would be greatly appreciated

cheers
timmy
 
But, I truly think that vlookup might work out better for you

Basically you would make a table that in column 1 contained the possible entries that you would need to change, column 2 would contain what you want the data in column 1 changed to. Probably naming that table then use this as your formula.

=Vlookup(A2, Lookuptable, 2, 0)
dragging down as needed.

that works great...but just one thing...if a value doesn't change N/A appears in the cell, is there anyway to get it so that it the name appears.
For example,
With "Afghanistan" there's no change to be made, but "n/a" appears. anyway around this so that "Afghanistan" appears?
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
timmy2uk

You're not going to get anywhere with this unless you answer Norie's initial basic questions.
 
Upvote 0
You can wrap the VLOOKUP in ISNA.

=IF(ISNA(VLOOKUP(A1, TableRange, 2, 0)), A1, VLOOKUP(A1, TableRange, 2, 0))

Obviously use your VLOOKUP and references.:)
 
Upvote 0
You can wrap the VLOOKUP in ISNA.

=IF(ISNA(VLOOKUP(A1, TableRange, 2, 0)), A1, VLOOKUP(A1, TableRange, 2, 0))

Obviously use your VLOOKUP and references.:)

cheers, that worked perfectly =)

thanks to everyone for their help, it is greatly appreciated
 
Upvote 0

Forum statistics

Threads
1,224,802
Messages
6,181,054
Members
453,014
Latest member
Chris258

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
Back
Top