+ Reply to Thread
Results 1 to 5 of 5

If Statement with a list item?

  1. #1
    Registered User
    Join Date
    12-16-2009
    Location
    Middlesbrough
    MS-Off Ver
    Excel 2003
    Posts
    2

    If Statement with a list item?

    Hey, i'm trying to make a spreadsheet for a game called Travian...

    Each troop has different requirements to be created... (Wood,Clay,Iron,Wheat)



    So a shortened version of what i'm doing will be...

    A list, which looks like...

    Legionaire
    Pretorian
    Imperian

    These are given a value of 1 2 3 in the list feature.

    Then i will have 4 collumns... Wood,Clay,Iron,Wheat, and i need each one to read a different value (depending on what i choose in the dropdown list)
    (for example sakes, the output which the list gives, will go in A17)
    The Forumla i tried was....

    So, i tried an if statement saying...

    =IF(A17="1",1000,IF(A17="2",2000,IF(A17="3",3000)))

    Even though A17 reads 1 2 or 3. the value which the if statement is outputting is ALWAYS false. (even if it doesn't show 1 2 3)

    Does anyone have an idea what the problem is with this?

    Or better still, does anyone know how to make a list. Which will have 1 input (Legionaire) (pretorian etc..) but have the ability to output 4 seperate outputs in 4 seperate cells?


    Thanks


    Andy

  2. #2
    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 with a list item?

    1) don't put quotes around numbers, that turns them into text.
    2) Try this instead:

    =A17*1000

    or

    =LOOKUP(A17, {1,2,3}, {1000,2000,3000})

    or

    =CHOOSE(A17, 1000, 2000, 3000)
    Last edited by JBeaucaire; 12-16-2009 at 03:15 PM.
    _________________
    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!)

  3. #3
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: If Statement with a list item?

    Based on a rough assumption, I think you're attempting to do something like what's in the attached sheet. Let me know if that helps.

    mew!
    Attached Files Attached Files
    =IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)

  4. #4
    Registered User
    Join Date
    12-16-2009
    Location
    Middlesbrough
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: If Statement with a list item?

    Thank's for the help you guys, i'll try the second option, seems to have a better visal representation and it "Should" make it easyer for me to manage lol.

    Thanks again


    Andy

  5. #5
    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 with a list item?

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].



    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated. It is found across from the "time" in each of our posts.)

+ 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