ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Countif between two dates (https://www.excelbanter.com/excel-discussion-misc-queries/165595-countif-between-two-dates.html)

AOP

Countif between two dates
 
I have the following formular:

=IF($B5002="","",COUNTIF(MAIN!$B$10:$B$5000,"" &$B5002 & ""))
Column A is the date
Column B is the unit

How do I modify it to count between two dates that are in cells Sheet2 P3
and R3

Thank you
--
AOP

Don Guillett

Countif between two dates
 
adapt to suit
=sumproduct((a2:a22b1)*(a2:a22<=b2))

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"AOP" wrote in message
...
I have the following formular:

=IF($B5002="","",COUNTIF(MAIN!$B$10:$B$5000,"" &$B5002 & ""))
Column A is the date
Column B is the unit

How do I modify it to count between two dates that are in cells Sheet2 P3
and R3

Thank you
--
AOP



Bob Phillips

Countif between two dates
 
=IF($B5002="","",SUMPRODUCT(--(Main!$A$10:$A$5000=Sheet2!P3),--(Main!$A$10:$A$5000<=Sheet2!R3),--(Main!$B$10:$B$5000=$B5002)))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"AOP" wrote in message
...
I have the following formular:

=IF($B5002="","",COUNTIF(MAIN!$B$10:$B$5000,"" &$B5002 & ""))
Column A is the date
Column B is the unit

How do I modify it to count between two dates that are in cells Sheet2 P3
and R3

Thank you
--
AOP




AOP

Countif between two dates
 
That works fine
Thank you
--
AOP


"Bob Phillips" wrote:

=IF($B5002="","",SUMPRODUCT(--(Main!$A$10:$A$5000=Sheet2!P3),--(Main!$A$10:$A$5000<=Sheet2!R3),--(Main!$B$10:$B$5000=$B5002)))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"AOP" wrote in message
...
I have the following formular:

=IF($B5002="","",COUNTIF(MAIN!$B$10:$B$5000,"" &$B5002 & ""))
Column A is the date
Column B is the unit

How do I modify it to count between two dates that are in cells Sheet2 P3
and R3

Thank you
--
AOP






All times are GMT +1. The time now is 06:50 AM.

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