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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change text depending on the value in a field?

Status
Not open for further replies.

frontside

Technical User
Sep 26, 2002
85
SE
I have a field that gets a value from a business system. the value could be (BA12, or any other combination) I want this value to change to something else for example

BA12 to 10%
BA13 to 15%

Is there an easy way of doing this?

I would be glad for any ideas or suggestions.


Mikael "Sweden"
 
Will there be infinite combos or a finite few?
Do you prefer VBA code or Formulas?

Provide all the rules if you can.
 
The vlookup function will return a value in a new column that coresponds to the code...

you set up on a table for vlookup to reference...

say in cols. AA,AB

AA AB
BA12 10%
BA13 15%
etc...

then the formula if the "code" is in col A...


=vlookup(A2,AA:AB,2,false)


an alternate......

if the code sequencing is linear


=right(A2,1)*5&"%"


 
I will only be a few combos.

I´ve done some vba in access, havent used the formulas much.. I guess the easiest way is the best.

Thanks for your help!!!!

Micke
 
ETID's solution certainly works if you don't mind having the results in a new column, plus it preserves the original which is a good thing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top