+ Reply to Thread
Results 1 to 9 of 9

Two criteria to match to obtain result from database?

  1. #1
    Registered User
    Join Date
    02-02-2015
    Location
    Cornwall, England
    MS-Off Ver
    2010
    Posts
    13

    Two criteria to match to obtain result from database?

    Hello all, I have recently posted a query
    I am creating a 'Mileage Calculator' in order to deduce the reimbursable miles employees drive per week. I am using Excel and have a database of all the possible 'A-B' combinations of our local postcodes (UK), and the distance in miles between each once, for example: | PL34 0ES | PL34 0AT | 0.7 |. The user, on a different sheet, selects a starting postcode and a finishing postcode for each of the journeys from a drop down list. What formula would I use to display the distance from the database as a result of the two input postcodes? Any help MUCH appreciated. Been trying to sort this all week
    I suppose I did not word it as best a possible, so I have attached my spreadsheet. Places are selected on sheet1 (mileage calculator) and it displays the postcodes in the boxes nextdoor. J9:J46 Would display distances as a result of the information in sheet2 (database), though I can't for the life of me figure out how to do it. Please please someone help a newb in distress

    Mileage calculatorsam (1).xlsx

    PS: Accidently deleted formula from a few top boxes of of the postcode box on Sheet1, just drag up from a lower undeleted cell.
    Last edited by samuelleach; 02-05-2015 at 12:29 PM.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Two criteria to match to obtain result from database?

    As mentioned in your previous thread, LOOKUP can do the trick

    J9:
    Please Login or Register  to view this content.
    Quang PT

  3. #3
    Registered User
    Join Date
    02-02-2015
    Location
    Cornwall, England
    MS-Off Ver
    2010
    Posts
    13

    Re: Two criteria to match to obtain result from database?

    Thankyou so much! One last thing, it now says N/A in the lower cells and as a result won't calculate total amount. Is there anything I can do so that that doesn't show? THANKS AGAIN!!!!!

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Two criteria to match to obtain result from database?

    Use this structure:

    =IFERROR("Formula here","")

    means If Formula error, returns blank, else returns result.

  5. #5
    Registered User
    Join Date
    02-02-2015
    Location
    Cornwall, England
    MS-Off Ver
    2010
    Posts
    13

    Re: Two criteria to match to obtain result from database?

    So I would use =IFERROR("=LOOKUP(2,1/((Database!$M$6:$M$1449=Mileage_Calculator!G9)*(Database!$N$6:$N$1449=Mileage_Calculator!I9)),Database!$O$6:$O$1449)","") ?

  6. #6
    Registered User
    Join Date
    02-02-2015
    Location
    Cornwall, England
    MS-Off Ver
    2010
    Posts
    13

    Re: Two criteria to match to obtain result from database?

    That just shows the formula, it doesn't seem to put it into work

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Two criteria to match to obtain result from database?

    Try this

    =IFERROR(LOOKUP(2,1/((Database!$M$6:$M$1449=Mileage_Calculator!G9)*(Database!$N$6:$N$1449=Mileage_Calculator!I9)),Database!$O$6:$O$1449),"")

  8. #8
    Registered User
    Join Date
    02-02-2015
    Location
    Cornwall, England
    MS-Off Ver
    2010
    Posts
    13

    Re: Two criteria to match to obtain result from database?

    You are the best thing on the internet. THANKYOU!

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Two criteria to match to obtain result from database?

    You are welcome.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. What formula do I require for two criteria to match in order to give result?
    By samuelleach in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-05-2015, 12:30 PM
  2. Replies: 9
    Last Post: 02-04-2015, 09:26 AM
  3. Subtract time and obtain result in minutes
    By cssst5 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-03-2014, 12:53 PM
  4. [Macro] Enter multiple set of values to obtain result in a certain way in excel
    By chocochoco in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2013, 03:13 AM
  5. Using Begins with to obtain result
    By Christopherdj in forum Excel General
    Replies: 2
    Last Post: 11-07-2011, 09:30 PM

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