+ Reply to Thread
Results 1 to 6 of 6

excel 2003 look up formula

  1. #1
    Registered User
    Join Date
    10-27-2009
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2003
    Posts
    26

    excel 2003 look up formula

    I have 3 different costs for an item, 15 different items. The costs very depending on the delivery state. Is it possible to write a formula that will retrun the right cost for an item, depending on the delivery state?

    if ap10 = "CA" then look up in range AH2 to AH18
    if ap10 = "GA" then look up in range AI2 to AI18
    if ap10 = "ME" then look up in range AI2 to AI18
    if ap10 = "PR" then look up in range AI2 to AI18
    if ap10 = any other state then look up in range AG2 to AG18

    cell AP10 being the cell that the state is listed in
    Cell U10 being the cell that item is in (a drop down menu)



    This is the vlookup formula that will get one price.

    =IF(ISNA(VLOOKUP($U10,TABLE!$AF$2:TABLE!$AI$18,2,FALSE)),"",VLOOKUP($U10,TABLE!$AF$2:TABLE!$AI$18,2,FALSE))

    Last edited by Grumpy9215; 10-27-2009 at 04:04 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: excel 2003 look up formula

    If I've understood you perhaps:

    =INDEX($AG$2:$AI$18,MATCH($U10,$AF$2:$AF$18,0),IF($AP10="CA",2,IF(OR($AP10={"GA","ME","PR"}),3,1)))

  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: excel 2003 look up formula

    It's possible to restructure a very long and ugly IF statement to take care of that, but when you're evaluating the SAME cell over and over again, there's usually a better way.

    Click GO ADVANCED and use the paperclip icon to post up your workbook. Let us look at some examples of what you're doing and I'm sure something more appropriate will be possible.

    EDIT:....if Don's answer doesn't do it for you.
    Last edited by JBeaucaire; 10-27-2009 at 02:51 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!)

  4. #4
    Registered User
    Join Date
    10-27-2009
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: excel 2003 look up formula

    I've attached the zipped file. The states are in a drop down menu in column AP. there are 3 diiferent cost for each retrofit package - the diiference in cost depends on which state is the final destination. The look up table is on the sheet "TABLE".
    Attached Files Attached Files

  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: excel 2003 look up formula

    Don nailed it then, just missing the sheet references. Put this in V10 and copy down:

    =INDEX(TABLE!$AG$2:$AI$18, MATCH($U10, TABLE!$AF$2:$AF$18, 0), IF($AP10="CA", 2,IF(OR($AP10={"GA","ME","PR"}), 3, 1)))


    Also, you don't need to error check the column U entries if you use a data validation list in column U that actually comes from the TABLE sheet. This eliminates errors in two separate tables.

    Just highlight TABLE!AF2:AF18 and type RetroFitOptions into the NAME BOX (just to the left of the formula bar). Then in column V of the BUY SHEET use the data validation source of =RetroFitOptions.

    Now, if you edit/remove items from the list on TABLE, the data validation list instantly changes too.
    Last edited by JBeaucaire; 10-27-2009 at 03:53 PM.

  6. #6
    Registered User
    Join Date
    10-27-2009
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: excel 2003 look up formula

    Thank you for your assistance!

+ 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