+ Reply to Thread
Results 1 to 5 of 5

Index an array, return most recent repair, first three letters lookup

  1. #1
    Forum Contributor
    Join Date
    04-20-2011
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2007
    Posts
    121

    Index an array, return most recent repair, first three letters lookup

    Rows A, B, C is a growing list of Machine repairs.

    I need to capture the most recent repair by searching the first three letters of a word in Column C and enter the part and date into the table.

    (I am trying to populate Most Recent Repair Data table shown in the attachment. The data entered manually in the table is the result I am looking for)

    Can you help. Thanks in advance
    Chambo1160

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Index an array, return most recent repair, first three letters lookup

    G4:

    =IFERROR(LOOKUP(2,1/(($B$2:$B$16=$F4)*(LEFT($C$2:$C$16,3)=$H$3)),A$2:A$16),"")

    H4:

    =IFERROR(LOOKUP(2,1/(($B$2:$B$16=$F4)*(LEFT($C$2:$C$16,3)=$H$3)),C$2:C$16),"")

    I4:

    =IFERROR(LOOKUP(2,1/(($B$2:$B$16=$F4)*(LEFT($C$2:$C$16,3)=$J$3)),A$2:A$16),"")

    J4:

    =IFERROR(LOOKUP(2,1/(($B$2:$B$16=$F4)*(LEFT($C$2:$C$16,3)=$J$3)),C$2:C$16),"")

    and then copy all 4 cells down


    VLOOKUP always stops at the first match, whereas LOOKUP always stops at the last possible match. It's even possible to nest arrays into its parameters, as I have.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Contributor
    Join Date
    11-26-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: Index an array, return most recent repair, first three letters lookup

    Hi!

    If your repair table is constantly updated, you should consider making it a table (select the data then ctrl+t). This makes refering to certain columns much easier and eliminates the need of updating your ranges.

    If you do that, in G4, this formula works although I find it quite unattractive ^^

    =IF(MAX(IF((Table1[Machine]=$F4)*(NOT(ISERROR(SEARCH(H$3&"*",Table1[Repair information]))))*(Table1[Column1]=""),Table1[Repair Date],""))=0,"",MAX(IF((Table1[Machine]=$F4)*(NOT(ISERROR(SEARCH(H$3&"*",Table1[Repair information]))))*(Table1[Column1]=""),Table1[Repair Date],"")))

    (arrayed formula so ctrl+shift+enter)

    You can do it without the general IF function so just
    =MAX(IF((Table1[Machine]=$F4)*(NOT(ISERROR(SEARCH(H$3&"*",Table1[Repair information]))))*(Table1[Column1]=""),Table1[Repair Date];""))

    But it'll return 1/1/1900 when it should be empty, which is not very nice.


    Formula copy/pasted to I4 should work aswell.

    Regards
    Last edited by dourpil; 05-16-2014 at 08:18 AM.

  4. #4
    Forum Contributor
    Join Date
    04-20-2011
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2007
    Posts
    121

    Re: Index an array, return most recent repair, first three letters lookup

    Many thanks to both for your swift solutions. I will practise on the table solution.

    Best Regards

    Chambo

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Index an array, return most recent repair, first three letters lookup

    Or thirdly, try this one.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

+ 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 latest date Part repair information from an array
    By Martin Chamberlin in forum Excel General
    Replies: 2
    Last Post: 05-15-2014, 10:13 PM
  2. [SOLVED] Lookup first two letters and return the most recent data
    By Martin Chamberlin in forum Excel General
    Replies: 12
    Last Post: 05-12-2014, 02:38 AM
  3. [SOLVED] Index Match with lookup values containing letters, numbers and spaces
    By makinwaves in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-18-2014, 08:06 PM
  4. Replies: 4
    Last Post: 03-13-2013, 12:38 PM
  5. [SOLVED] matching index of an array - works for numbers not letters
    By gryffin13 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-27-2012, 10:43 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