+ Reply to Thread
Results 1 to 6 of 6

Cells Count Totals Only for Non-VLookup #N/A

  1. #1
    Forum Contributor garrett.grillo's Avatar
    Join Date
    06-19-2011
    Location
    San Francisco, California
    MS-Off Ver
    Excel Professional Plus 2016
    Posts
    194

    Cells Count Totals Only for Non-VLookup #N/A

    Hi Excel Forum Team,

    I need help on an equation that will provide a total count for everything in a VLookup Iv'e done, but does not count the #N/A that VLookup provides when it doesn't pick up a match and other blank cells below the VLookup table.

    Example:
    -> Cell 1A is where the total cell count equation is.
    -> Cell 2A thru. 11A is where the VLookup results are.
    -> So, if the VLookup results come up with 8 matching results (ex.: John, Mark, Linda, etc.) in cells 2A thru. 9A and 2 non-matching results providing a #N/A in both 10A & 11A cells and the remaining blank cells below in 12A thru. infinity; the cell counter equation (in cell 1A) would only show a total of 8.

    Thank you for reviewing my request for help!

    Garrett

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

    Re: Cells Count Totals Only for Non-VLookup #N/A

    =counta(a2:a1000)-countif(a2:a1000,#n/a)
    OR
    =COUNTIF(A2:A2000,"<>#N/A")
    Last edited by martindwilson; 04-27-2012 at 06:45 PM.
    "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

  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: Cells Count Totals Only for Non-VLookup #N/A

    a few points....

    you should add =if(iserror(vlookup(your-lookup-formula)),0 (or whatever else you wat to show),vlookup(your-lookup-formula))
    to count what you need, use =countif() eg =countif(range-you-want-to-count,
    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 garrett.grillo's Avatar
    Join Date
    06-19-2011
    Location
    San Francisco, California
    MS-Off Ver
    Excel Professional Plus 2016
    Posts
    194

    Re: Cells Count Totals Only for Non-VLookup #N/A

    Hi Martindwilson,

    Big Thank You!!! That equation did the trick!

    Garrett

  5. #5
    Forum Contributor garrett.grillo's Avatar
    Join Date
    06-19-2011
    Location
    San Francisco, California
    MS-Off Ver
    Excel Professional Plus 2016
    Posts
    194

    Re: Cells Count Totals Only for Non-VLookup #N/A

    Hi FDibbins,

    Big Thank You!!! That equation and help as well did the trick!

    Garrett

  6. #6
    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: Cells Count Totals Only for Non-VLookup #N/A

    you'r welcome. If this answered your question, please take a moment to mark the tread as "solved", and consider adding to the reputation of those who helped. Read points 2&3 below

+ 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