+ Reply to Thread
Results 1 to 17 of 17

IFERROR, INDEX, MATCH... formula... that also reads dates.

  1. #1
    Forum Contributor
    Join Date
    10-15-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    218

    IFERROR, INDEX, MATCH... formula... that also reads dates.

    Hi All,

    This one is hard to explain. Please see the attached file.

    I need a formula in Column G.

    This column reads the "Certificate Database" tab to see if there is a course that it matches with the employee. If so then it returned with the date that the certificate is expired, if there is no match, or state the expired date if in the future.

    Here is how I would like the logic to function. I've highlighted the relevant lines.

    If Column F is blank = blank.

    If Column F Has a value "R" match Column A with Column B in 'Certificate Database' tab.
    - Then match Column F1 for match in column D in 'Certificate Database' Tab.
    - Return the value of Column E in 'Certificate Database' Tab.

    Now if the value is prior to todays date. I would want the text to say "EXPIRED".
    Now if there is no match. I would want the text to day "No Record"
    Now if there is a match and date is later then today. I want the text to state the expiry date.

    Thank you in advance!!

    -Jason

    Training Database.xlsb

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    Something like this then? I converted your first sheet to a Table, that way I don't have to have 10000 row formula. The range expand automatically when data is added.
    Attached Files Attached Files
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  3. #3
    Forum Contributor stephenloky's Avatar
    Join Date
    07-10-2013
    Location
    Sao Paulo - Brazil
    MS-Off Ver
    Excel 2007
    Posts
    146

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    I did a example...see if works for you.
    Attached Files Attached Files
    "The quieter you become, the more you are able to hear"

    Any reputation (*) points appreciated.

    "If you know yourself but not the enemy, for every victory gained, you will suffer defeat."

  4. #4
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    This can be done with a VLOOKUP instead of index/match. Try this in G3 and copy down.

    Please Login or Register  to view this content.
    Last edited by Speshul; 07-21-2014 at 04:32 PM.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  5. #5
    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,938

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    Another 1 - an array in sheet2 G3, copied down
    ...
    =IFERROR(IF(F3="","",IF(INDEX('Certificate Database'!$F$2:$F$5801,MATCH(A3&"-"&$F$1,'Certificate Database'!$B$3:$B$9285&"-"&'Certificate Database'!$D$3:$D$9285,0))<TODAY(),"Expired",INDEX('Certificate Database'!$F$2:$F$5801,MATCH(A3&"-"&$F$1,'Certificate Database'!$B$3:$B$9285&"-"&'Certificate Database'!$D$3:$D$9285,0)))),"No Record")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    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

  6. #6
    Forum Contributor
    Join Date
    10-15-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    Quote Originally Posted by Jacc View Post
    Something like this then? I converted your first sheet to a Table, that way I don't have to have 10000 row formula. The range expand automatically when data is added.
    This seems to work great.

    I've never seen a table converted like this. Seems much easier to reference columns. My only concern is that i'm between entry level excel user and not sure what happens when I add columns as this is part of a much larger dataset.

    But this does function exactly as I requested! Great!

  7. #7
    Forum Contributor
    Join Date
    10-15-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    Quote Originally Posted by stephenloky View Post
    I did a example...see if works for you.
    Hi Stephen,

    This unfortunately didn't work as requested. The output was required, blank or expired. Where instead of required I wanted to see the date of expiry.

    Close - just didn't have the right information.

  8. #8
    Forum Contributor
    Join Date
    10-15-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    Quote Originally Posted by FDibbins View Post
    Another 1 - an array in sheet2 G3, copied down
    ...
    =IFERROR(IF(F3="","",IF(INDEX('Certificate Database'!$F$2:$F$5801,MATCH(A3&"-"&$F$1,'Certificate Database'!$B$3:$B$9285&"-"&'Certificate Database'!$D$3:$D$9285,0))<TODAY(),"Expired",INDEX('Certificate Database'!$F$2:$F$5801,MATCH(A3&"-"&$F$1,'Certificate Database'!$B$3:$B$9285&"-"&'Certificate Database'!$D$3:$D$9285,0)))),"No Record")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    This works great. Much easier to use then the table1 format (because i'm a beginner) as it's just a cut and paste formula.

    However, I got some values that didn't' quite add up and I discovered something. There are multiple entries for the same person. The person's certificate would expire and he/she would go and get a recertification. The formula will only pick up the person's earliest certificate. I tried to re-sort by date to see if it would pick up the more recent certificate but didn't have any effect.

    I realize this was my oversight and am sorry - but any way to modify this pick up the more newest date and if there are multiple entries?

    Thanks!

  9. #9
    Forum Contributor
    Join Date
    10-15-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    Quote Originally Posted by Speshul View Post
    This can be done with a VLOOKUP instead of index/match. Try this in G3 and copy down.

    Please Login or Register  to view this content.
    Hello Speshul,

    This worked well for about 70% of the values I tested. I'm not sure what it is with this formula but some of the dates changed.

    For example.
    AAB00424995 your formula gives me 23-May-16 but the actual is 26-May-16
    AAB00424997 your formula gives me EXPIRED but the actual is 4-May-17
    AAB00425007 your formula gives me 27Aug-16 but the actual is 20-Aug-16

    but the other values would be correct.

    Strange.

  10. #10
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    VLOOKUP won't pick up duplicates of the lookup value, it will always return the first value it finds on the table. Are there duplicates of those three values?

    AAB00424995
    AAB00424997
    AAB00425007

  11. #11
    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,938

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    OK this is maybe a better way, it also avoids the use of an array.

    Add a helper column to Database (I used Q) and in Q2, copied down (I went to 10 000, use less if you think you wont need that much, just adjust the ranges as needed)...
    =IF(COUNTIFS(B2:$B$10000,B2,D2:$D$10000,D2)>1,"",B2&"-"&D2)

    Then use this regular formula on Course sheet, copied down...
    =IFERROR(IF(F3="","",IF(INDEX('Certificate Database'!$F$2:$F$10000,MATCH(A3&"-"&$F$1,'Certificate Database'!$Q$3:$Q$10000,0))<TODAY(),"Expired",INDEX('Certificate Database'!$F$2:$F$10000,MATCH(A3&"-"&$F$1,'Certificate Database'!$Q$3:$Q$10000,0)))),"No Record")

    The helper will pull the last entry for the name/course combo, which I presumed would also be the latest date for the combo

  12. #12
    Forum Contributor
    Join Date
    10-15-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    Quote Originally Posted by FDibbins View Post
    OK this is maybe a better way, it also avoids the use of an array.

    Add a helper column to Database (I used Q) and in Q2, copied down (I went to 10 000, use less if you think you wont need that much, just adjust the ranges as needed)...
    =IF(COUNTIFS(B2:$B$10000,B2,D2:$D$10000,D2)>1,"",B2&"-"&D2)

    Then use this regular formula on Course sheet, copied down...
    =IFERROR(IF(F3="","",IF(INDEX('Certificate Database'!$F$2:$F$10000,MATCH(A3&"-"&$F$1,'Certificate Database'!$Q$3:$Q$10000,0))<TODAY(),"Expired",INDEX('Certificate Database'!$F$2:$F$10000,MATCH(A3&"-"&$F$1,'Certificate Database'!$Q$3:$Q$10000,0)))),"No Record")

    The helper will pull the last entry for the name/course combo, which I presumed would also be the latest date for the combo
    All of the dates seems to not work. I'm guessing I did something wrong but I've re-read and can't seem to figure out what I did... Attached sheet with your formulas.
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    10-15-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    Quote Originally Posted by Speshul View Post
    VLOOKUP won't pick up duplicates of the lookup value, it will always return the first value it finds on the table. Are there duplicates of those three values?

    AAB00424995
    AAB00424997
    AAB00425007
    Yes, I tried to re-sort as well but I think the more viable option would be a formula that picked the most recent date.

    Sorry - this was my mistake as I forgot, only realized after the original post, that there would be multiple entries of the same training for the same person.

  14. #14
    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,938

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    take a look at the attched
    Attached Files Attached Files

  15. #15
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    Thanks for the rep! There are info out there about the Excel Table feature. The advantages makes them well worth learning, if you ask me.
    http://www.contextures.com/xlExcelTable01.html

  16. #16
    Forum Contributor
    Join Date
    10-15-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    Quote Originally Posted by FDibbins View Post
    take a look at the attched
    Thanks, I took a look at the sheet you provided and it still wasn't correct. It took me going back and forth a bunch of times to figure out what was happening...

    The formula you gave me..
    =IFERROR(IF(F3="","",IF(INDEX('Certificate Database'!$F$2:$F$10000,MATCH(A3&"-"&$F$1,'Certificate Database'!$Q$3:$Q$10000,0))<TODAY(),"Expired",INDEX('Certificate Database'!$F$2:$F$10000,MATCH(A3&"-"&$F$1,'Certificate Database'!$Q$3:$Q$10000,0)))),"No Record")
    I figured it was offset by one row... as soon I realized that I saw what the issue was... I change your formula to:

    =IFERROR(IF(F3="","",IF(INDEX('Certificate Database'!$F$2:$F$10000,MATCH(A3&"-"&$F$1,'Certificate Database'!$Q$2:$Q$10000,0))<TODAY(),"Expired",INDEX('Certificate Database'!$F$2:$F$10000,MATCH(A3&"-"&$F$1,'Certificate Database'!$Q$2::$Q$10000,0)))),"No Record")

    and this seemed to work very well.

    THANK YOU!!! sorry for all the confusion and all the help. Very much appreciate it!

  17. #17
    Forum Contributor
    Join Date
    10-15-2013
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: IFERROR, INDEX, MATCH... formula... that also reads dates.

    Quote Originally Posted by Jacc View Post
    Thanks for the rep! There are info out there about the Excel Table feature. The advantages makes them well worth learning, if you ask me.
    http://www.contextures.com/xlExcelTable01.html
    Thanks for the reference. Will do!

+ 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. Excel Formula: IFERROR, INDEX, SMALL, MATCH
    By Jenn12788 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-12-2014, 10:03 PM
  2. Help to simplify an =IF(IFERROR(INDEX(...,MATCH( formula
    By sa12345 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-11-2014, 03:40 AM
  3. [SOLVED] IFERROR+INDEX+MATCH Formula is not returning the correct value
    By bxk006 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-16-2013, 09:50 AM
  4. Wrong result displaying using IFERROR-INDEX-MATCH-ROW Formula
    By paradise2sr in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-16-2013, 01:03 PM
  5. Looking for better formula of iferror, index and match
    By DavidRoger in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-23-2012, 07:50 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