+ Reply to Thread
Results 1 to 4 of 4

IF Statement involving a List

  1. #1
    Registered User
    Join Date
    05-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    15

    IF Statement involving a List

    Hi,

    Im trying to allocate a role title to report for staff members from data that is exported from our companies reporting system. I originally did it like this:
    =IF(OR(B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x",B2="x"),"Role Title 1",IF(OR(B2="x",B2="x",B2="x",B2="x",B2="x"),"Role Title 2",IF(OR(B2="x",B2="x",B2="x",B2="x"),"Role Title 3",IF(OR(B2="x",B2="x",B2="x"),"Role Title 4","External Source")))

    Where x is the name of the companies staff members and there corresponding role title, external source obviously is the false value.

    This formula works fine for the purpose, it took me about an hour to enter (I had to look up everyones role titles etc), however if the staff change roles or new staff i would prefer not to have to edit the formula too much. So i tried entering the names into a different sheet and creating the formula from the list. The formula I used:

    =IF(B2=Sheet2!A3:A30,"Role Title 1"), hasnt worked (I obviously haven't got to the other role titles as my first preliminary effort failed.

    I get the #VALUE1 error, I have ensure each lot of cells are TEXT format.

    Does anyone have any ideas? Is there a better/different formula that would work?

    Cheers.

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: IF Statement involving a List

    Hi,

    a possibility

    Please Login or Register  to view this content.
    Hope it helps
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: IF Statement involving a List

    I would recommend you look at creating a standard lookup table on sheet2 listing all the names in column A, then corresponding values for each in column B, the use a simple VLOOKUP() against the value you enter into sheet1 B2 against that table.

    =VLOOKUP(B2, Sheet2!$A:$B, 2, 0)

    or...

    =IFERROR(VLOOKUP(B2, Sheet2!$A:$B, 2, 0), "External Source")
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    05-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: IF Statement involving a List

    Thanks Very Much, Both worked, Vlookup a little less complicated!

+ 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