+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : IF Statement Help

  1. #1
    Registered User
    Join Date
    11-01-2010
    Location
    San Diego
    MS-Off Ver
    Excel 2007
    Posts
    38

    IF Statement Help

    Hello All !!!

    I have to create a spreadsheet that basically shows an employee's department and their supervisor.

    So basically

    Accounting boss is - Weinberg
    Customer Service boss - Jones
    Human Resource boss is Patterson...

    so and so forth ...

    So to put it simply I basically want:

    A=1
    B=2
    C=3
    D=4


    There are 26 departments in my company.
    This is what I am thinking about using

    =IF(B4="A","1",IF(B4="B","2",IF(B4="C","3",IF(B4="D","4",))))

    Is there an easier way to do it? Or do I have to IF 26 times?

    Thanks ahead of time.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,636

    Re: IF Statement Help

    You could use VLOOKUP or INDEX/MATCH with a pre-defined table, or you could use CHOOSE to select from a list.

    If B4 contains A, whatever,
    Please Login or Register  to view this content.
    would return 1

    Regards
    Last edited by TMS; 11-04-2010 at 03:14 PM. Reason: improved formula
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor
    Join Date
    10-17-2010
    Location
    Nottingham, England
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013, 2016, 2019, 365
    Posts
    294

    Re: IF Statement Help

    For more detail on using VLOOKUP for this task, look here:
    Categorising data with VLOOKUP

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1