Counting number of instances before a certain date

  • Thread starter Thread starter JLH
  • Start date Start date
J

JLH

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.
 
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
 
How does one put a subroutine into Excel?

Don said:
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top