+ Reply to Thread
Results 1 to 6 of 6

IF statement ?

Hybrid View

  1. #1
    Registered User
    Join Date
    12-02-2007
    Posts
    8

    IF statement ?

    i'm stuck on the last part of a spreadsheet i'm working on. seems like it should be pretty simple but i just can't figure it out. can't seem to find an answer via F1 or google.

    lets say the value of A1 is labeled "Qty" and A2 is labeled "Discount Tier". i need to place a formula in A2.

    if the value in A1 is less than 10, the number returned in A2 needs to be 1.
    if the value of A1 is between 10 and 14, the number returned in A2 needs to be 2.
    if the value of A1 is greater than 14, the number returned in A2 needs to be a 3.


    so for example, a qty of 16, would be in Discount tier 3.

    i have tried things like:
    =IF(A1>9,2,IF(A1>14,3,1))
    but i'm just making a mess of things now...

    any help would be greatly appreciated.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =LOOKUP(A1,{0,10,15},{1,2,3})
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    12-02-2007
    Posts
    8
    my god that was fast! and it works!

    i knew about vlookup but how is this working so easily? is there a link you can direct me to or something i can reference in the help file?

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Your welcome.

    Link should help

    http://www.techonthenet.com/excel/formulas/lookup.php

    VBA Noob

  5. #5
    Registered User
    Join Date
    12-02-2007
    Posts
    8
    a fantastic reference! i can use this all over the place. thanks again!

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    If you liked that link check the "useful links" below out for more

    VBA Noob

+ 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