View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default 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.