Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

# Excel - Picking letter in a string

### #1 ChrisWright Posted 31 October 2006 - 01:53 PM

ChrisWright

Member

• Member
• 34 posts
Hello,

I am working on a project in which data is restricted to choices, and then records those choices in abreviated form, e.g.

Choice 1: blue green red
Abreviated: bl gr re

Choice 2: stitched stapled
Abreviated: sti sta

Choice 3: Type01 Type02 Type03
Abreviated: 01 02 03

The abreviated forms will be all stored in a single cell for each record (although seperate cells may be used for calculations)

Therefore, examples of the possible results of the choices could be:

blsti01 (for Blue, Stitched and Type01)

--or--

grsti03 (for Green, Stitched and Type03)

--or--

resta02 (for Red, Stapled and Type02)

I need to understand how to use the functions RIGHT, LEFT and LEN (as i believe these are what are needed), to create a system to pick the information back out from the combined abreviations...

By this I mean it should take 'blsti01' and be able to take the bl , sti and 01 back out. From this point, I am able to design the rest... Any help ??

Chris W

Edited by ChrisWright, 31 October 2006 - 01:56 PM.

• 0

### #2 piper Posted 31 October 2006 - 03:07 PM

piper

Retired Staff

• Retired Staff
• 2,459 posts
If I understand what you want to do, you've got a cell with blsti01 and want to use the functions to expand it back to words?

If (Left(a2,2)="bl", "Blue", if (RIGHT(a2,2)="gr", "Green", "Red"))
You're comparing cell A2, the left 2 characters.

If (Mid(a2,3,2)="sti", "Stitched", "Stapled")
You're comparing cell A2, the middle 2 characters beginning at the 3rd character.

If (RIGHT(a2,2)="01", "Type 01", if (RIGHT(a2,2)="02", "Type 02", "Type 03"))
You're compariing cell a2, the right 2 characters.

If this isn't what you need, post back.
• 0

### #3 ChrisWright Posted 31 October 2006 - 05:28 PM

ChrisWright

Member

• Topic Starter
• Member
• 34 posts
Thank you !

This is an almost perfect solution to the problem, although you made a typo in the Excel code (don't worry, I fixed it easily !)

Once again, thank you for your help !

Chris W

• 0

### Similar Topics

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users