View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
nikolasp[_3_] nikolasp[_3_] is offline
external usenet poster
 
Posts: 1
Default How to Calculate Peak and Off Peak Hours


I was trying to avoid pivot tables for one reason or another. What
have come up with so far is the following:

n = 24
For i = 1 To n
If Cells(3 + i, 3) 6 And Cells(3 + i, 3) < 23 Then
avg = avg + (Cells(3 + i, 4))
End If
Next i
Range("f2") = avg / 16

However, this works for only one set of dates and prices, i.e. all th
prices for 11/1/05 in this example. I'm trying to get some ideas as t
how to do this iteratively for each of the different dates. In th
above code n=24 represents the number of hours during each day

--
nikolas
-----------------------------------------------------------------------
nikolasp's Profile: http://www.hightechtalks.com/m40
View this thread: http://www.hightechtalks.com/t229836