+ Reply to Thread
Results 1 to 13 of 13

IFERROR with VLookUP and 2 critera

  1. #1
    Registered User
    Join Date
    03-02-2018
    Location
    Nottm
    MS-Off Ver
    365
    Posts
    72

    IFERROR with VLookUP and 2 critera

    So I have a list of stores 1 - 13 that are in my range of A32:B55

    In my cell, I need to see if that store number is listed in 2 different columns.

    Here's my formula for one column only, but I want it to give me "both" if the store number is listed in 2 different columns (not just F19 in this case), and "missed" if only in 1 column or neither column. So I need to include the "If(AND somewhere, just not sure how to make that work.

    =IFERROR(VLOOKUP(F19,$A$32:$B$44,2,FALSE),"MISSED")

    Thank you.
    Last edited by KirbyKat; 04-17-2019 at 12:40 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: IFERROR with VLookUP and 2 critera

    Try this:
    Please Login or Register  to view this content.
    Does that give you what you're looking for?

  3. #3
    Registered User
    Join Date
    03-02-2018
    Location
    Nottm
    MS-Off Ver
    365
    Posts
    72

    Re: IFERROR with VLookUP and 2 critera

    No. I changed one of the cells to E19 and kept the F15, but all of my results come up as "missed", even if they're both matches to my store numbers.

  4. #4
    Registered User
    Join Date
    03-02-2018
    Location
    Nottm
    MS-Off Ver
    365
    Posts
    72

    Re: IFERROR with VLookUP and 2 critera

    I had edited my original post fyi, sorry if you missed it. Changed the vlookup range to a32:b55, and put the word both" in all the B column cells.

  5. #5
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: IFERROR with VLookUP and 2 critera

    Can you attach a workbook with a sample of your data and expected results? That will greatly help in finding a solution.

    To attach a workbook, click Go Advanced, then scroll down a bit to Manage Attachments. Click Browse to find your file, then click Open, and finally click Upload. Click Close this window, and your file will be attached when you submit your reply.

  6. #6
    Registered User
    Join Date
    03-02-2018
    Location
    Nottm
    MS-Off Ver
    365
    Posts
    72

    Re: IFERROR with VLookUP and 2 critera

    So here's my new formula, but it's all still coming up "missed"
    =IFERROR(IF(AND(MATCH($E15,$A$32:$B$44,2),MATCH($F15,$A$32:$B$44,2)),"BOTH"),"MISSED")

  7. #7
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,448

    Re: IFERROR with VLookUP and 2 critera

    MATCH doesn't work with an array that is more than one cell wide.

    Please attach a workbook.
    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.

  8. #8
    Registered User
    Join Date
    03-02-2018
    Location
    Nottm
    MS-Off Ver
    365
    Posts
    72

    Re: IFERROR with VLookUP and 2 critera

    see attachment
    Attached Files Attached Files

  9. #9
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,448

    Re: IFERROR with VLookUP and 2 critera

    I think you need this:

    =IFERROR(IF(AND(MATCH($D4,$A$21:$A$33,0),MATCH($D4,$C$4:$C$10,0)),"BOTH"),"MISSED")

    You have not understood how the MATCH function works - I suggest you read up on it.

  10. #10
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: IFERROR with VLookUP and 2 critera

    I'm not exactly sure what cells A21:B33 have to do with your results. Based on your sample, this should work in cell E4:
    Please Login or Register  to view this content.
    Does that provide the results you're looking for?

  11. #11
    Registered User
    Join Date
    03-02-2018
    Location
    Nottm
    MS-Off Ver
    365
    Posts
    72

    Re: IFERROR with VLookUP and 2 critera

    I didn't use the MATCH originally, someone on this thread suggested it.

  12. #12
    Registered User
    Join Date
    03-02-2018
    Location
    Nottm
    MS-Off Ver
    365
    Posts
    72

    Re: IFERROR with VLookUP and 2 critera

    It does. Thank you so much!!!

  13. #13
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,448

    Re: IFERROR with VLookUP and 2 critera

    I didn't use the MATCH originally, someone on this thread suggested it.
    It doesn't alter the fact that you are using it incorrectly, and not in the way Melvosh suggested.

    As I stated earlier, you cannot have two columns of data in a MATCH array - you can only have one. So, you cannot use $A$32:$B$44, but you CAN use $A$32:$A$44.

    Here's the correct syntax for what you are trying to do:

    =MATCH(lookup_value,lookup_array,0)

    The 0 at the end ensures that the MATCH returns an exact match.

+ 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. Vlookup in pivot table mulitle critera
    By mfputer in forum Excel General
    Replies: 1
    Last Post: 06-01-2016, 11:32 AM
  2. Replies: 1
    Last Post: 10-16-2014, 04:29 PM
  3. [SOLVED] Iferror vlookup
    By chris.slater in forum Excel General
    Replies: 2
    Last Post: 04-20-2012, 03:37 AM
  4. Excel 2007 : Vlookup with critera in multple columns
    By fentontech in forum Excel General
    Replies: 1
    Last Post: 11-17-2011, 12:42 PM
  5. IFERROR With VLOOKUP
    By Badvgood in forum Excel General
    Replies: 2
    Last Post: 05-11-2011, 09:27 AM
  6. Excel 2007 : Vlookup and iferror help soon...
    By MRKINGSTON1976 in forum Excel General
    Replies: 1
    Last Post: 10-28-2009, 03:21 PM
  7. Vlookup (3 critera)
    By Engineers08 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2008, 11:44 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