+ Reply to Thread
Results 1 to 9 of 9

Searching through a table with multiple criteria

  1. #1
    Registered User
    Join Date
    06-01-2018
    Location
    Edmonton, AB
    MS-Off Ver
    2010
    Posts
    4

    Searching through a table with multiple criteria

    I have an excel sheet that I'm trying to search through multiple criteria to check that the term of something does not exceed the allowable length.

    There are multiple criteria that change, including a "Tier", "Year", "KM's" and "Term". I need to reference my table to match up the tier/year/km's/term to ensure the TERM does not exceed the allowable one.

    I got it working using a whole bunch of nested IF AND statements however I have exceed the 64 allowable and need another option.

    Example of the statement i had that was working:
    A87 = TIER
    A92 = YEAR
    C44 = MAX TERM
    A95 = KM's

    =IF(AND(A87=2,A92=2008,C44>12,A95<=180000),12,
    IF(AND(A87=2,A92=2009,C44>24,A95<=180000),24,
    IF(AND(A87=2,A92=2010,C44>36,A95<=165000),36,
    IF(AND(A87=2,A92=2010,C44>30,A95<=180000),30,
    IF(AND(A87=2,A92=2011,C44>48,A95<=180000),48,
    IF(AND(A87=2,A92=2012,C44>60,A95<=130000),60,
    IF(AND(A87=2,A92=2012,C44>54,A95<=165000),54,
    IF(AND(A87=2,A92=2012,C44>48,A95<=180000),48,

    I'm thinking I need to VLOOKUP but not sure how to go about it with multiple criteria needing to match in multiple rows.

    I've attached a link to a picture of what i'm try to do (because i cannot upload an excel for some reason):

    imgur.com/gallery/jiQO7SK
    Last edited by iangill; 06-01-2018 at 04:21 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Searching through a table with multiple criteria

    Hi, welcome to the forum

    You might be able to do this with INDEX/MATCH, but to help more, I suggest that you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    06-01-2018
    Location
    Edmonton, AB
    MS-Off Ver
    2010
    Posts
    4

    Re: Searching through a table with multiple criteria

    Thank you I do believe the INDEX/MATCH function will work.

    The match function seems to work if everything matches EXACTLY, however the km's is never going to be an exact number. How do i get it to check if its maybe within a range of numbers?

    For example:
    Submitted KMs: 167500

    Tier Year Max KM's Max Term
    2 2010 165000 36
    2 2010 180000 30

    How do I get it to know that the max term for those km's is 30 and not 36 when the km's do not match the table?
    Last edited by iangill; 06-01-2018 at 04:47 PM.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Searching through a table with multiple criteria

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  5. #5
    Registered User
    Join Date
    06-01-2018
    Location
    Edmonton, AB
    MS-Off Ver
    2010
    Posts
    4

    Re: Searching through a table with multiple criteria

    Added sample.

    I need a way for the function to work when the km's are not an exact number to the number in the table (a range?). Cannot figure this out... Thanks!
    Attached Files Attached Files
    Last edited by iangill; 06-01-2018 at 05:31 PM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,448

    Re: Searching through a table with multiple criteria

    Nope. Try again.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Searching through a table with multiple criteria

    I dont see any difference between tier 2 and 3? Does your real data differ from the sample?

    Also, are you looking to find the term based on the lowest closest KM's

  8. #8
    Registered User
    Join Date
    06-01-2018
    Location
    Edmonton, AB
    MS-Off Ver
    2010
    Posts
    4

    Re: Searching through a table with multiple criteria

    That is just a small sample, there are more tiers/years than that data but I figured it would show what i'm trying to accomplish.

    For example:
    Submitting information of:
    Tier 2
    Year 2010
    KM's: 170000
    Term 30

    Tier Year Max KMs Max Term
    2 2010 165000 36
    2 2010 180000 30

    The submitting information qualifies for the term of 30 months (as it is greater than 165000km's). So I guess I'm looking to confirm the term based on the highest closes km's based on Tier/Year.

    The formula I have in the excel sheet seems to work only if the KM's submitted are exactly the same as on my table - is there any way to make it confirm a range instead of exact number?
    Last edited by iangill; 06-01-2018 at 06:32 PM.

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,667

    Re: Searching through a table with multiple criteria

    If I understand correctly then I believe the following formula will yield correct results:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. [SOLVED] Return single value by searching multiple criteria in multiple column
    By Ramesh h&m in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 07-01-2017, 07:02 AM
  2. IF Function I think.....searching a table with multiple criteria
    By FANNINGT in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-22-2016, 01:23 PM
  3. Replies: 7
    Last Post: 06-30-2015, 03:39 PM
  4. [SOLVED] Searching for Multiple criteria using different columns
    By In a pickle in forum Excel General
    Replies: 11
    Last Post: 06-28-2015, 08:17 PM
  5. Replies: 4
    Last Post: 12-16-2014, 10:36 AM
  6. Searching a table for multiple criteria to return single result
    By erice in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-16-2014, 09:53 AM
  7. Searching Multiple Criteria in a Column with multiple data
    By cmmercer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-26-2014, 08:16 AM

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