Forum Discussion

El1-_321's avatar
El1-_321
Copper Contributor
Jul 23, 2019

countif / index / match

Hi Twifoo 

 

Are you able to help me with a formula? I am having trouble with countif/index/match..

 

I need to look at a range of data (+PLOD'!$H$2:$AX$1048576) and count the number of times a figure appears ($C$1) if the date ('PLOD Sum'!B2) appears in this field ('+PLOD'!$B$2:$B$1048576)

 

The formula I am using is this:

=IFERROR(COUNTIF(INDEX('+PLOD'!$H$2:$AX$1048576,MATCH('PLOD Sum'!B2,'+PLOD'!$B$2:$B$1048576,0),),$C$1),"No Data")

 

The issue I am having is there is more than one date row with relevant figures to count, so when I use the above formula it works but is only counting the first row with the relevant date instead of the number of rows with the relevant date... I hope this makes sense?

Thank you in advance!

6 Replies

  • Twifoo's avatar
    Twifoo
    Silver Contributor

    El1-_321 

    Let me rephrase your requirement to this: 

     

    COUNT the instances of the value in C1 in the range '+PLOD'!H2:AX1048576, only in rows where the date in 'PLOD SUM'!B2 is found in '+PLOD'!B2:B1048576; otherwise, return "No Data". 

     

    The foregoing requirement translates to this formula: 

    IF(SUMPRODUCT(('+PLOD'!H2:AX1048576=C1)*

    ('PLOD'!B2:B1048576='PLOD SUM'!B2)),

    SUMPRODUCT(('+PLOD'!H2:AX1048576=C1)*

    ('PLOD'!B2:B1048576='PLOD SUM'!B2)),

    "No Data")

    • El1-_321's avatar
      El1-_321
      Copper Contributor

      Thank you Twifoo I understand the logic, but this formula doesn't seem to be working in excel..

       

      I am getting an error stating 'Excel ran out of resources while attempting to calculate one or more formulas. As a result, these formulas cannot be evaluated'

       

       

       

      • Twifoo's avatar
        Twifoo
        Silver Contributor
        Instead of using direct references, define them as dynamic ranges. Thereafter, use those defined names in the formula I suggested.

Resources