# Countif

#### vgoodman

##### New Member
I have created a formula (below) that sums a range based on a date (quarters) in another cell.
=SUMIF(L5:BZ5,">="&A60,L40:BZ40)-SUMIF(L5:BZ5,">="&A61,L40:BZ40)

Additionally, I have a countif formula to get a count in the same period, ie,
=(COUNTIF(L5:BZ5,">="&A60)-COUNTIF(L5:BZ5,">="&A61))

However, now, I have been asked to create a formula that counts based on a date, but also a value. For example, I need to count all the "5's" between January 1, 05 and March 31, 05.

Any thoughts???????

### Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

#### Oaktree

##### MrExcel MVP
Code:
``=SUMPRODUCT(--(L5:BZ5<A60),--(L5:BZ5>=A61),--(L6:BZ6=5))``

#### vgoodman

##### New Member
What does the "--" reference?

Thanks

Replies
2
Views
139
Replies
2
Views
96
Replies
2
Views
134
Replies
2
Views
85
Replies
3
Views
54