• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

count with horizontal criteria dates and other criteria

Reggieneo

Member
Hi All,
how to countifs with horizontal dates range and other criteria,

I have tried sumproducts but just could make it work.
please see sample file for ref
appreciate the help.
 

Attachments

  • count with horizontal criteria date.xlsx
    12 KB · Views: 4
Hi Marc L,
I was hoping to get an excel function or vba solution. No I don’t have the link.


▬▬▬▬▬▬▬▬▬ Mod edit : thread moved to the Excel forum
for a formula solution …
 
SUMPRODUCT will work but the key is to use the sales person to down-select the goods table to a single row. Equally COUNTIFS will work because INDEX returns a reference to the row. Define Name 'selectedGoods' to refer to
= INDEX( goods, MATCH(person,salesPerson,0), )

The answer is given by the worksheet formula
= COUNTIFS( selectedGoods, "<>",
saleDate, ">="&startDate,
saleDate, "<="&endDate )


ps I also agree with p45cal's solution of an INDEX:INDEX pair to define the exact range.
 

Attachments

  • count with horizontal criteria date (PB).xlsx
    13.3 KB · Views: 5
Hi p45cal, awesome blank counting with index match, thanks.

Hi Peter, that is one elegant solution. I need to really study to use name range with list formula reference.

thanks to you both, I can use these two.
 
Another formula option

1] In M4, copied down :

=COUNTIF(OFFSET(B4,0,MATCH(C$17,C$2:L$2,0),1,MATCH(D$17,C$2:L$2,0)-MATCH(C$17,C$2:L$2,0)+1),"*")

2] In E17, enter :

=COUNTIF(OFFSET(B$2,MATCH(B17,B$3:B$14,0),MATCH(C$17,C$2:L$2,0),1,MATCH(D$17,C$2:L$2,0)-MATCH(C$17,C$2:L$2,0)+1),"*")

Regards
Bosco
 

Attachments

  • count date(1).xlsx
    13.9 KB · Views: 3
Back
Top