+ Reply to Thread
Results 1 to 9 of 9

Index match formula not working properly, keeps returning 0

  1. #1
    Forum Contributor
    Join Date
    07-06-2009
    Location
    London, England
    MS-Off Ver
    Microsoft 365, Excel, Version 2409
    Posts
    210

    Index match formula not working properly, keeps returning 0

    Hi,
    I am trying to count how many times "Yes" occurs in column D when a match is found on a worksheet called data
    This is my formula built up from internet research. It keeps returning 0, but should return 55.

    Please Login or Register  to view this content.
    Maybe there is a better way to do it?

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,155

    Re: Index match formula not working properly, keeps returning 0

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,706

    Re: Index match formula not working properly, keeps returning 0

    the above will return count of Yes in data!An:APn where n is determined by the MATCH
    however, note that the MATCH looks as rows $3:$100, not $2:$100 as used by the COUNTIF, so you have an offset being applied
    i.e. if MATCH of A2 occurs in data!D3 (row 1 of MATCH range) you are counting Yes' in data!A2:AP2 (row 1 of INDEX range), and not A3:AP3

    if the above is not the explanation, (i.e. offset is expected/desired)
    - remove the outer IFERROR to see if the 0 is being returned because of an underlying error (i.e. the MATCH) rather than the COUNT itself being 0
    - if non-error and count is 0, check the underlying values on Data actually contain "Yes" (and no other characters etc)
    Last edited by XLent; 06-23-2023 at 11:12 AM.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,779

    Re: Index match formula not working properly, keeps returning 0

    I can think of a couple of ways to interpret your description, and I can't reconcile your description with the formula you are giving us.

    Can you attach the file so we can see your data?
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  5. #5
    Forum Contributor
    Join Date
    07-06-2009
    Location
    London, England
    MS-Off Ver
    Microsoft 365, Excel, Version 2409
    Posts
    210

    Re: Index match formula not working properly, keeps returning 0

    Thanks for your help.
    Mock up attached (I had to remove sensitive data)

    Book1.xlsx

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,432

    Re: Index match formula not working properly, keeps returning 0

    There is no match. What are you expecting it to return? There's an #NA error that is returning the 0, which is what you've told it to do.

    Explain in detail what the objective is.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,896

    Re: Index match formula not working properly, keeps returning 0

    B2
    =IFERROR(COUNTIF(INDEX(data!$A$3:$J$100,,MATCH($A2,data!$A$2:$J$2, 0) ), B$1), 0)

    copied down and across.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    07-06-2009
    Location
    London, England
    MS-Off Ver
    Microsoft 365, Excel, Version 2409
    Posts
    210

    Re: Index match formula not working properly, keeps returning 0

    Thank you. This works perfectly. Really appreciated
    Last edited by AliGW; 06-23-2023 at 11:45 AM. Reason: Please do NOT quote unnecessarily!

  9. #9
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,896

    Re: Index match formula not working properly, keeps returning 0

    You are welcome.

+ 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] Index/Match formula not working properly from data in Pivot Tables - HELP!
    By Pooger in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-07-2020, 04:24 PM
  2. Index Match formula not working properly
    By nikhil.mehta in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-24-2020, 06:33 AM
  3. [SOLVED] Index, Match, Row, Small functions are properly not set in my formula
    By rajeshn_in in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-09-2016, 04:24 AM
  4. [SOLVED] Sumif with an index formula not working properly
    By Panfergrrl18 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-30-2015, 12:49 AM
  5. Index and Match across multiple rows and columns look up not working properly
    By jollyfella in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-09-2015, 12:06 AM
  6. [SOLVED] Multiple IF's & Index/Match - Not working properly
    By Pooger in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-10-2015, 04:01 PM

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