• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 765
  • Last Modified:

Excel 2007/2010 Multiple if statement

Dear excel gurus,
I am in need of some help.  I have a column with numbers in it starting in B2 and ending at B7660.
I need a MULTIPLE IF statement that will allow me to identify what type of number it is, so for example;

587691663
597935792
416115780
619267069
297935792
616115780
319267069
115542018
115542018

If the first number begins with a
1 = Shop.Order
2 = Rwk.Order
4 = Purch. Order
5 = PM-Maint
3,6 = Plan.Order

So I i have the statement correct in column O, then it would look like this.

B2                                 O2
587691663                   PM-Maint
597935792                   PM-Maint
416115780                   Purch. Order
619267069                   Plan.Order
297935792                   Rwk.Order
616115780                   Plan.Order
319267069                   Plan.Order
115542018                   Shop.Order
115542018                   Shop.Order

Any help with this will be greatly appreciated.
0
BajanPaul
Asked:
BajanPaul
1 Solution
 
SteveCommented:
see attached:

Vlookup example based upon first number against table of types

Can put the table of types on another sheet.

Will do the job and easier to maintain.

Can create as Function if you are happy with using UDF (VBA)
Lookup.xlsx
0
 
ScriptAddictCommented:
Where A1 is the number,  this should do it for you:

=CHOOSE(LEFT(TRIM(A1),1),"Shop.Order","Rwk.Order","Plan.Order","Purch.Order","PM-Maint","Plan.Order")
0
 
BajanPaulAuthor Commented:
Works perfectly with VLOOUP.  Thanks greatly I didn't think of that.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now