# Thread: Alpha Spilt of Surnames

1. ## Alpha Spilt of Surnames

Aplogises, if I dont explain this one very well, I'll do my best,

I'm using an Excel Sheet to record incomming work.

I would like to cut down some manual input by getting Excel to do a simple calculation for me.

Work is split across two teams, on an aplha split basis.

Team 1 deals with any surnames from A-L
Team 2 deals with any surnames from M-Z.

The two columns that I'm dealing with is:

NAME and TEAM

To make it more interesting the names are inputted as: Firstname first and surname second such as:

AUTO ALPHA SPILT.bmp

I would like excel to auto-populate the next column (ie TEAM) by inserting either a 1 or 2, based on the surname split as mentioned above.

What is the best way to achieve this, by way of forumla or Macro, can anyone help me create this?

2. Raish,

This should solve your problem: =IF((CODE(UPPER(MID(A2,SEARCH(" ",A2)+1,1)))-64<13),1,2)

Note: the formula ignores capitalization. However, Middle initials/names will trip it up.

3. ## The Following User Says Thank You to RetiredGeek For This Useful Post:

RAISH (2011-07-26)

4. Originally Posted by RetiredGeek
Raish,

This should solve your problem: =IF((CODE(UPPER(MID(A2,SEARCH(" ",A2)+1,1)))-64<13),1,2)

Note: the formula ignores capitalization. However, Middle initials/names will trip it up.
Thanks for that, We dont use middle names so that should be rock solid for us. Thats brillant. This will help save abit of time. Every little helps.

Can I ask another one?

How do you get Excel to automatically insert a particular word into a column, say for arguements sake the word "TEST", if the user has in a previous column typed the word FEE? (picture below) Again would this be better done as a macro or forumla?, given that the result also occupies this same field as the above example.

specific word.bmp

Thanks for all the help.

5. Something like this?
=If(A2="Fee", "TEST",IF((CODE(UPPER(MID(A2,SEARCH(" ",A2)+1,1)))-64<13),1,2))

Steve

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•