View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Allllen[_2_] Allllen[_2_] is offline
external usenet poster
 
Posts: 13
Default If part of a cell = "NVA" then insert "Norfolk" in return cell

Judging by the third example "Selma" I would guess you have many more places
than just Norfolk and Richmond.

=MID(C2,2,3)
gives you the NVA, RVA, SNC

You can have some extra columns, let's say X and Y, where you will have the
correspondence between NVA and Norfol etc:

Col X Col Y
NVA Norfolk
RVA Richmond
SNC Selma
etc

So what you need in column J will be:
=VLOOKUP(MID(C2,2,3),X:Y,2,0)

--
Allllen


"RNCKWMN" wrote:

Column C has various 8 character codes (city & state abbreviations). One #
and 7 alpha. If the 2nd, 3rd & 4th characters = "NVA" then I want it to
return "Norfolk" in a Column J... if they = "RVA" it should return "Richmond"

Column C Column J
0NVARIVA should yield Norfolk
2RVACFVA should yield Richmond
1SNCEUNC should yield Selma

What formula or function do i use to make this happen?