Forum Discussion

rangelsammon's avatar
rangelsammon
Copper Contributor
Sep 16, 2022

multiple count using different rows comparing multiple columns

some assistance please!

i posted something prior but i think i confused the matter. maybe this clears it up

 

count how many times a the name in column A has a "yes" in column C and a "yes" in column D that occurred at the same number as column B
the answer here should be 1 for John
but if I change B9 to 2. then the answer should be 2

 

ABCD
john2 yes
john2  
john2yes 
rick1.5  
john1  
rick0.5  
john0  
john1yesyes
rick0.5  
john0  

 

i tried multiple ways and im left at this

=SUMPRODUCT(("yes"=data[C]=data[B]=INDEX(data[B],MATCH("yes",data[C])))*("yes"=data[D]=data[B]=INDEX(data[B],MATCH("yes",data[D]))))

 

it just isnt working in so many ways i try. is this possible without vlookup? or offset? i have a big sheet so i just would love to have some direction on how to achieve this problem

 

attached the online version

 

Book1.xlsx

16 Replies

  • Harun24HR's avatar
    Harun24HR
    Bronze Contributor
    Why it would 2 when you change B9 cell to 2? Why not 1 or 3?
    • rangelsammon's avatar
      rangelsammon
      Copper Contributor
      because column C's "yes" happens when column B is the same number when column D is "yes"
      • mathetes's avatar
        mathetes
        Silver Contributor
        What happens if B11 turns to 2?

        I think this is still pretty confusing. You'll need to come up with more examples under varying conditions to make your underlying heuristic (rule) unambiguously clear, before it can be turned into a reliable formula.

Resources