View Single Post
  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

Joe,

Saw you in the torrents group today and remembered I hadn't answered your
post. Here is a solution

Function accmgrsum(start_date, end_date, date_array, bookings_array)
Dim sFormula As String

sFormula = "SUMPRODUCT(--(" & date_array.Address(external:=True) & _
"=--""" & Format(CDate(start_date), "yyyy-mm-dd")
& """)," & _
"--(" & date_array.Address(external:=True) & _
"<=--""" & Format(CDate(end_date), "yyyy-mm-dd") &
""")," & _
bookings_array.Address(external:=True) & ")"
accmgrsum = Evaluate(sFormula)
End Function


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Joe Blow" wrote in message
...
On Mon, 17 Jan 2005 21:30:44 -0000, "Bob Phillips"
wrote:


=SUMPRODUCT(--(Bookings!D3:D7=--"2005-01-01"),--(Bookings!D3:D7<=--"2005-0

1
-31"),Bookings!H3:H7)

No VBA!


Thanks Bob, the reason I am using vba is that I need to call this
macro repeatedly with many differing dates. This is just my test case.
Any ideas?

Joe