+ Reply to Thread
Results 1 to 15 of 15

IF statement with multi criteria returns "#N/A"

  1. #1
    Registered User
    Join Date
    12-06-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    IF statement with multi criteria returns "#N/A"

    I need to create an IF statement to identify a specific scenario that occurs within a large amount of data. I have the criteria that needs to be met in cells B1-B4, but the fields that I'm matching them to are in different rows and columns (in this example it's row 11 columns F&D, and column AA rows 9&4). This is the formula that I'm using but it keeps returning "#N/A" where it should be returning a "YES"
    =IF(AND(F11=B1,AA9=B2,D11=B3,AA4=B4),"YES","NO")
    Please help!!
    Thank you

  2. #2
    Forum Contributor Legend Rubber's Avatar
    Join Date
    09-21-2012
    Location
    Tillsonburg, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    392

    Re: IF statement with multi criteria returns "#N/A"

    can you attach a sample workbook?
    Also, your code needs to be in code tags.

  3. #3
    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
    53,048

    Re: IF statement with multi criteria returns "#N/A"

    check te cells that are being tested, and make sure none of them are returning an error message

    if that still doesnt help, i would suggest you upload a sample workbook for me to look at
    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

  4. #4
    Forum Contributor Legend Rubber's Avatar
    Join Date
    09-21-2012
    Location
    Tillsonburg, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    392

    Re: IF statement with multi criteria returns "#N/A"

    This is workign for me...

  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
    53,048

    Re: IF statement with multi criteria returns "#N/A"

    @ Legend Rubber, you only really need to use code tags if you are pasting VBA code here. some people use code tags or quote tags for formulas if they are very long (span multiple lines), but otherwisew, for a simple formula like the 1 above, tags are not really necessary

  6. #6
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: IF statement with multi criteria returns "#N/A"

    Any of the cells used in the cell returning any error? Do they contain valid data?

  7. #7
    Forum Contributor Legend Rubber's Avatar
    Join Date
    09-21-2012
    Location
    Tillsonburg, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    392

    Re: IF statement with multi criteria returns "#N/A"

    @FDibbins, thanks for the adjustment...
    i didnt know that...
    Sorry ms-excelnewbie

  8. #8
    Registered User
    Join Date
    12-06-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: IF statement with multi criteria returns "#N/A"

    Here's a sample of the file with the formula in it.
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: IF statement with multi criteria returns "#N/A"

    B2 cell is showing error!

  10. #10
    Registered User
    Join Date
    12-06-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: IF statement with multi criteria returns "#N/A"

    No, the "#N/A" is actually the proper returned result. That's what it shows when there's no exceptions, and that's the value that I want as part of the criteria

  11. #11
    Valued Forum Contributor
    Join Date
    08-14-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    573

    Re: IF statement with multi criteria returns "#N/A"

    But i think excel can recognize it as error only. Can't it be represented in some other way?

  12. #12
    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
    53,048

    Re: IF statement with multi criteria returns "#N/A"

    Quote Originally Posted by FDibbins View Post
    check te cells that are being tested, and make sure none of them are returning an error message
    perhaps you missed this post?

  13. #13
    Registered User
    Join Date
    12-06-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: IF statement with multi criteria returns "#N/A"

    Thank you!! I changed the "#N/A" to simply "N/A" and it worked!!
    Thanks again for your help!!

  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
    53,048

    Re: IF statement with multi criteria returns "#N/A"

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  15. #15
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: IF statement with multi criteria returns "#N/A"

    fwi worth you can use formuls tags
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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