ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Counting number of instances before a certain date (https://www.excelbanter.com/excel-worksheet-functions/114634-counting-number-instances-before-certain-date.html)

JLH

Counting number of instances before a certain date
 
I am trying to keep a running count of how many oustanding items I
have.

Column A has an "In" date
Column B has an "Out" date

In Column C I would like to add up how many items in A are before the
out date in B.

If A1:A5 = 3/1/06, 3/13/06, 3/8/06, 3/17/06, 4/6/06
and B1:B5 = " ", 3/24/06, 3/24/06, " ", 5/11/06

where " " is a blank cell

C1:C5 = 1, 2, 3, 4, 3

I don't think that the COUNTIF function is the answer because the dates
in B can be manually entered at a later date.

Thanks in advance for any help.


Don Guillett

Counting number of instances before a certain date
 
one way
Sub countlessthan()
For Each c In Range("d1:d5")
If c < c.Offset(, 1) Then mc = mc + 1
Next c
MsgBox mc
End Sub

--
Don Guillett
SalesAid Software

"JLH" wrote in message
ups.com...
I am trying to keep a running count of how many oustanding items I
have.

Column A has an "In" date
Column B has an "Out" date

In Column C I would like to add up how many items in A are before the
out date in B.

If A1:A5 = 3/1/06, 3/13/06, 3/8/06, 3/17/06, 4/6/06
and B1:B5 = " ", 3/24/06, 3/24/06, " ", 5/11/06

where " " is a blank cell

C1:C5 = 1, 2, 3, 4, 3

I don't think that the COUNTIF function is the answer because the dates
in B can be manually entered at a later date.

Thanks in advance for any help.




JLH

Counting number of instances before a certain date
 
How does one put a subroutine into Excel?

Don Guillett wrote:
one way
Sub countlessthan()
For Each c In Range("d1:d5")
If c < c.Offset(, 1) Then mc = mc + 1
Next c
MsgBox mc
End Sub

--
Don Guillett
SalesAid Software

"JLH" wrote in message
ups.com...
I am trying to keep a running count of how many oustanding items I
have.

Column A has an "In" date
Column B has an "Out" date

In Column C I would like to add up how many items in A are before the
out date in B.

If A1:A5 = 3/1/06, 3/13/06, 3/8/06, 3/17/06, 4/6/06
and B1:B5 = " ", 3/24/06, 3/24/06, " ", 5/11/06

where " " is a blank cell

C1:C5 = 1, 2, 3, 4, 3

I don't think that the COUNTIF function is the answer because the dates
in B can be manually entered at a later date.

Thanks in advance for any help.



Don Guillett

Counting number of instances before a certain date
 
http://www.mvps.org/dmcritchie/excel...ll.htm#install

--
Don Guillett
SalesAid Software

"JLH" wrote in message
ups.com...
How does one put a subroutine into Excel?

Don Guillett wrote:
one way
Sub countlessthan()
For Each c In Range("d1:d5")
If c < c.Offset(, 1) Then mc = mc + 1
Next c
MsgBox mc
End Sub

--
Don Guillett
SalesAid Software

"JLH" wrote in message
ups.com...
I am trying to keep a running count of how many oustanding items I
have.

Column A has an "In" date
Column B has an "Out" date

In Column C I would like to add up how many items in A are before the
out date in B.

If A1:A5 = 3/1/06, 3/13/06, 3/8/06, 3/17/06, 4/6/06
and B1:B5 = " ", 3/24/06, 3/24/06, " ", 5/11/06

where " " is a blank cell

C1:C5 = 1, 2, 3, 4, 3

I don't think that the COUNTIF function is the answer because the dates
in B can be manually entered at a later date.

Thanks in advance for any help.





JLH

Counting number of instances before a certain date
 
How do I put the number in the cell vice having a msg box pop up with
the number? I want this to be a running count that is always visible
for historical purposes.


Don Guillett

Counting number of instances before a certain date
 
range("a2")=mc

--
Don Guillett
SalesAid Software

"JLH" wrote in message
oups.com...
How do I put the number in the cell vice having a msg box pop up with
the number? I want this to be a running count that is always visible
for historical purposes.





All times are GMT +1. The time now is 04:31 AM.

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