+ Reply to Thread
Results 1 to 6 of 6

INDEX and MATCH using 4 separate Criteria

  1. #1
    Registered User
    Join Date
    09-04-2012
    Location
    nope
    MS-Off Ver
    Excel 2007
    Posts
    8

    INDEX and MATCH using 4 separate Criteria

    OK, this is what I am working with! It’s a very complicated workbook, and I have multiple (23) sheets in my work book.
    This workbook is for Military Aviation Airframe inspection schedules. (Yes, I’m military)

    Narratives aka names of inspections are listed in my table TABLE_18[NARR]
    Airframe hour when inspection in narrative is due TABLE_18[DUE]
    Sheet Table to display all information on ACFT_STATUS
    Aircraft Serial number on ACFT_Status sheet ACFT_STATUS[TAIL]
    Aircraft serial number (Last 3 of the "tail" ex.. 789) [EI_SN]
    PMI = PHASE MAINTENANCE INSPECTION


    The below formula is placed in ACFT_STATUS Table in a column named [PMI DUE]

    (Sorry if too much information, I like to understand what the information means when i work with formulas.)

    This current formula compares Black Hawk UH60L model Helicopter, two major inspections occur at different intervals, I’m looking for the one [due] first aka "MIN"

    Everything in my workbook is an array, there are thousands of entries for multiple aircraft, so I have to match the aircraft [EI_SN] to the inspection to ensure
    I have the correct aircraft [EI-SN] and then the correct inspection in this case [PMI-1] or [PMI-2]. I use connections to query my database and placed into TABLE_18.

    =IF(INDEX(TABLE_18[DUE],MATCH("PMI-1", IF(TABLE_18[EI_SN]=ACFT_STATUS[[#THISROW],[TAIL]],TABLE_18[NARR]),0))
    <INDEX(TABLE_18[DUE],MATCH("PMI-2",IF(TABLE_18[EI_SN]=ACFT_STATUS[[THISROW],[TAIL]],TABLE_18[NARR]),0)),
    INDEX(TABLE_18[DUE],MATCH("PMI-1",IF(TABLE_18[EI_SN]=ACFT_STATUS[[THISROW],[TAIL]],TABLE_18[NARR]),0)),
    INDEX(TABLE_18[DUE],MATCH("PMI-2",IF(TABLE_18[EI_SN]=ACFT_STATUS[[THISROW],[TAIL]],TABLE_18[NARR]),0))

    THIS FORMULA IS RIDICULOUS! I’m sure there is a simpler way to write it, however this is what worked for me.

    So, if you are still with me - This has worked for my needs for months, However I now have UH60M model aircraft as well and I need to rewrite my
    Formula, So I now need to compare two different model aircraft UH60L and UH60M model aircraft. The UH60M model aircraft inspection are the same, however
    the inspections [NARR] are not worded the same.

    These inspections are called "Perform 720 Hour PMI-1" and "Perform 720 Hour PMI-2", the kicker is that I need this ONE formula to look for all 4
    Inspections that match aircraft [EI_SN] and give me the closest [DUE] located in TABLE_18.

    The 4 inspections are Named
    "PMI-1" "PMI-2" compare give MIN if they exist in table_18
    "Perform 720 Hour PMI-1" "Perform 720 Hour PMI-2", compare give MIN if they exist in table_18

    [DUE] is number
    [NARR] is text
    [EI_SN] is number
    [TAIL] is number

    I know this formula does not work and is not even a formula but to clarify:

    =index(table_18[due],Match("PMI-1","PMI-2,"Perform 720 Hour PMI-1", "Perform 720 Hour PMI-2") if(ACFT_STATUS[TAIL]=TABLE_18[EI_SN] return [DUE] MIN


    To keep from getting more complicated that I have already, when this formula "runs" there will only be two of these inspections available in this table available at any
    given time. If you want a explanation for this, ask I will explain. Placing this formula in another worksheet or workbook is NOT an option.

    I have worked for days, tried MIN, IFERROR, and tried a ton of IF statements, then Google'd the Internet - reached the END of the internet, and came here to ask for help.

    Also, my workbook is "Sensitive" so only sample information is contained in the Cleaned Workbook posted below.

    Thanks for reading my Novel
    Last edited by swill008; 04-06-2013 at 02:29 PM. Reason: updated workbook

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: INDEX and MATCH using 4 separate Criteria

    I was in the AF back in the 70's. Aircraft hydraulic technician. Worked on B52s and KC135s.

    Personally, I hate that structured formula syntax.

    Can you make up a SMALL sample file using generic data that demonstrates what you're wanting to do? We only need about 20 rows worth of data.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    09-04-2012
    Location
    nope
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: INDEX and MATCH using 4 separate Criteria

    The database is on another system that is not connected to the network, however I can work something out when I get back home then send you a sample database extract.

    EDIT: Ill be back at my home computer in about 1 hour from now.

  4. #4
    Registered User
    Join Date
    09-04-2012
    Location
    nope
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: INDEX and MATCH using 4 separate Criteria

    Removed SpreadSheet
    Last edited by swill008; 04-06-2013 at 02:28 PM. Reason: Removed Excel spreadsheet

  5. #5
    Registered User
    Join Date
    09-04-2012
    Location
    nope
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: INDEX and MATCH using 4 separate Criteria

    Alright, Got it solved.

    Had to use this formula:

    =MIN(IFERROR(INDEX(Table_18[DUE],MATCH("PMI-1",IF(Table_18[EI_SN]=[@TAIL],Table_18[NARR]),0)),1000000000),IFERROR(INDEX(Table_18[DUE],MATCH("PMI-2",IF(Table_18[EI_SN]=[@TAIL],Table_18[NARR]),0)),1000000000),IFERROR(INDEX(Table_18[DUE],MATCH("PERFORM 720 HOUR PMI-1",IF(Table_18[EI_SN]=[@TAIL],Table_18[NARR]),0)),1000000000),IFERROR(INDEX(Table_18[DUE],MATCH("PERFORM 720 HOUR PMI-2",IF(Table_18[EI_SN]=[@TAIL],Table_18[NARR]),0)),1000000000))

    Since MIN function passes any error or N/A as a 0(zero) I had to tell MIN to error to something that I would never see in my table. I guess I over done it with the 0's, but hey it works

    So there is one way to bypass MIN's limitation!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: INDEX and MATCH using 4 separate Criteria

    That structured table referencing looks like so much gobbledygook to me!

    At least you got something that works.

    Good luck!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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