+ Reply to Thread
Results 1 to 7 of 7

Formula for Primary and Secondary Lookup Tables

  1. #1
    Forum Contributor
    Join Date
    06-30-2010
    Location
    swindon, england
    MS-Off Ver
    Office 365
    Posts
    101

    Formula for Primary and Secondary Lookup Tables

    I am trying to create a spreadsheet to provide product cost prices from two separate tables of data.

    I can use a standard lookup formula to provide a cost price from one table, but if there is no cost price for a specific product in that first table, I'd like the formula to then use a second table to find the result instead.

    If there is not a cost price for said product in either table then the formula should return the result "-".

    I have attached a very basic example of the tables. Part codes could appear in either the first or second table, but any result available in the first table should supersede the result in the second table.

    Hope that all makes sense and could anyone please help?
    Attached Files Attached Files

  2. #2
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Formula for Primary and Secondary Lookup Tables

    Hi jimbokeep

    Perhaps, something like this!

    =IF(ISNA(VLOOKUP(A3,$D$3:$E$11,2,0)),VLOOKUP(A3,$G$3:$H$8,2,0),VLOOKUP(A3,$D$3:$E$11,2,0))
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Formula for Primary and Secondary Lookup Tables

    Try in B2 and copy down.

    =IFERROR(IFERROR(INDEX($E$3:$E$11,MATCH(A3,$D$3:$D$11,0)),INDEX($H$3:$H$8,MATCH(A3,$G$3:$G$8,0))),"")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Forum Contributor
    Join Date
    06-30-2010
    Location
    swindon, england
    MS-Off Ver
    Office 365
    Posts
    101

    Re: Formula for Primary and Secondary Lookup Tables

    Thank you both, I will test these on the actual document when I am back in the office tomorrow and confirm the results.

  5. #5
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Formula for Primary and Secondary Lookup Tables

    @ Fotis1991

    jimbokeep uploaded a .xls file!

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Formula for Primary and Secondary Lookup Tables

    Didn't see it Kevin UK. Thank you for mentioned this.

    As you know we can use if(iserror in Excel 2003, but formula will be to long!

  7. #7
    Forum Contributor
    Join Date
    06-30-2010
    Location
    swindon, england
    MS-Off Ver
    Office 365
    Posts
    101

    Re: Formula for Primary and Secondary Lookup Tables

    Again thank you both for the help with this. The IFERROR solution was the perfect fit for the problem in the end.

+ 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