ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I put a date range in the criteria of a countif formula? (https://www.excelbanter.com/excel-discussion-misc-queries/119748-how-do-i-put-date-range-criteria-countif-formula.html)

hlpmelrn

How do I put a date range in the criteria of a countif formula?
 
=COUNTIF('Local Annual Sales'!B4:B19,"=38991") this works to show all
months creater then Oct 2006 how do I limit it to =38991 <=39022 Oct
31, 2006?????

Biff

How do I put a date range in the criteria of a countif formula?
 
Try one of these:

Use cells to hold your date range:

A1 = 10/1/2006
B1 = 10/31/2006

=COUNTIF(B4:B19,"="&A1)-COUNTIF(B4:B19,""&B1)

Or, with the dates hardcoded:

=COUNTIF(B4:B19,"=10/1/2006")-COUNTIF(B4:B19,"10/31/2006")

Format the cell as GENERAL or NUMBER

Biff

"hlpmelrn" wrote in message
...
=COUNTIF('Local Annual Sales'!B4:B19,"=38991") this works to show all
months creater then Oct 2006 how do I limit it to =38991 <=39022
Oct
31, 2006?????




hlpmelrn

How do I put a date range in the criteria of a countif formula
 
Thanks Biff I will try that, just to let every one know this can be done
with an formula array by entering this: =SUM(IF('Local Annual
Sales'!B4:B19=38991,IF('Local Annual Sales'!B4:B19<=39022,1,0),0)) then
pressing CRTL+SHFT+ENT which will put curly brackets around it. If you type
the curly brackets it will not work. the =DATEVALUE(01/10/2006) can be use
to determine the values between. Just thought I let you know how I fixed
it that night.

GREAT your =COUNTIF('Local Annual
Sales'!B4:B19,"=10/1/2006")-COUNTIF('Local Annual
Sales'!B4:B19,"10/31/2006") is much better and it works to.



"Biff" wrote:

Try one of these:

Use cells to hold your date range:

A1 = 10/1/2006
B1 = 10/31/2006

=COUNTIF(B4:B19,"="&A1)-COUNTIF(B4:B19,""&B1)

Or, with the dates hardcoded:

=COUNTIF(B4:B19,"=10/1/2006")-COUNTIF(B4:B19,"10/31/2006")

Format the cell as GENERAL or NUMBER

Biff

"hlpmelrn" wrote in message
...
=COUNTIF('Local Annual Sales'!B4:B19,"=38991") this works to show all
months creater then Oct 2006 how do I limit it to =38991 <=39022
Oct
31, 2006?????





Biff

How do I put a date range in the criteria of a countif formula
 
You're welcome. Thanks for the feedback!

Biff

"hlpmelrn" wrote in message
...
Thanks Biff I will try that, just to let every one know this can be done
with an formula array by entering this: =SUM(IF('Local Annual
Sales'!B4:B19=38991,IF('Local Annual Sales'!B4:B19<=39022,1,0),0)) then
pressing CRTL+SHFT+ENT which will put curly brackets around it. If you
type
the curly brackets it will not work. the =DATEVALUE(01/10/2006) can be
use
to determine the values between. Just thought I let you know how I
fixed
it that night.

GREAT your =COUNTIF('Local Annual
Sales'!B4:B19,"=10/1/2006")-COUNTIF('Local Annual
Sales'!B4:B19,"10/31/2006") is much better and it works to.



"Biff" wrote:

Try one of these:

Use cells to hold your date range:

A1 = 10/1/2006
B1 = 10/31/2006

=COUNTIF(B4:B19,"="&A1)-COUNTIF(B4:B19,""&B1)

Or, with the dates hardcoded:

=COUNTIF(B4:B19,"=10/1/2006")-COUNTIF(B4:B19,"10/31/2006")

Format the cell as GENERAL or NUMBER

Biff

"hlpmelrn" wrote in message
...
=COUNTIF('Local Annual Sales'!B4:B19,"=38991") this works to show
all
months creater then Oct 2006 how do I limit it to =38991 <=39022
Oct
31, 2006?????








All times are GMT +1. The time now is 07:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com