Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Formulas in Excel

Status
Not open for further replies.

dwayne94

Programmer
Aug 14, 2007
21
US
Look at the attached list below. I have this list in Excel and I was asked to create a formula so that MEDICAL, VISION and DENTAL can be known as MED, VIS and DEN respectively. How would I create a formula to reflect that? In other words i need to create a formula in this manner if cell A1 = MEDICAL, then "MED". Can this be done in Ecxel or would I find it easier to do in Access.

FirstName LastName BenefitCode
James Geiger MEDICAL
James Geiger HSA
James Geiger DENTAL
James Geiger VISION
James Geiger PRESC
James Geiger LIFEMP
James Geiger ADD
James Geiger LIFEMPV
James Geiger ADDV
James Geiger LIFSPV
James Geiger STD
James Geiger LTD
James Geiger HCRA
James Geiger DCRA
James Geiger EEASS
James Geiger SICK
 
=IF(C2="Medical","MED",IF(C2="Dental","DEN",IF(C2="VISION","VIS",C2)))

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
Another way.

Code:
=IF(OR(TRIM(UPPER(C2))="MEDICAL", TRIM(UPPER(C2))="DENTAL", TRIM(UPPER(C2))="VISION"), LEFT(C2, 3), C2)
 
Both options above do what you have asked to do.

However, I bet that is not what you really need to do.
 
Maybe Edit,Replace is more appropriate?


Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top