# Cell Value

#### chad32

##### New Member
Hi. In Column A I have a number of differnet country codes and for 2 of them I want to change the value in Column B. For Example if cell A1 is = to "SHA" I want cell B2 to be "SHANGHAI". If cell A1= to "SGN" I want B1 to be = to "HO CHI MINH". If cell A1 is = to anything else I want the value to B2 to remain unchanged.

### Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

#### Oaktree

##### MrExcel MVP
Try something like =CHOOSE(1+(A1="SHA")+2*(A1="SGN"),B1,"Shanghi","Ho Chi Minh")

#### chad32

##### New Member
I could'nt get it to work. Is there anything else i could try?

#### Dave Patton

##### Well-known Member
try
=IF(OR(A2={"SGN","SHA"}),LOOKUP(A2,\$K\$2:\$L\$3),A2)

or equivalent

=IF(OR(A4={"SGN","SHA"}),LOOKUP(A4,{"SGN","HO CHI MINH";"SHA","SHANGHAI"}),A4)

Revise ranges as necessary

Replies
15
Views
446
Replies
0
Views
271
Replies
8
Views
281
Replies
0
Views
172
Replies
5
Views
266

Threads
1,191,287
Messages
5,985,760
Members
439,981
Latest member
ofori francis

### 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

### 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