Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Titanus,
In the next column - I'm guessing D, but the Cliff Notes version may not be specific enough ;-) - enter this formula in D2 and copy down: =IF(AND(SUM($C$1:C2)360,SUM($D$1:D1)=0),ROW(),"") and copy down for 50 rows. The number that appears in column D will be your count. You could show that value in another cell by simply using =SUM(D:D) HTH, Bernie MS Excel MVP "Titanus" wrote in message oups.com... This routine comes on the heels of the following: I have a column called Phase (which is in degrees), which runs, say, from A1:A100. Then the next column is DePhase (also in degrees) which = Phase(current cell) - Phase(prior cell). The next column is a DePhase smoother called DePhase2 where, based on certain conditions of Phase and DePhase I come up with a better value for DePhase. Now, the routine I want to run will sum the DePhase2's to reach 360 degrees. The sum is the InstPeriod.) So then I need to Excel-ize the following: InstPeriod = 0; Value4 = 0; For count = 0 to 50 begin Value4 = Value4 + DePhase[count]; If Value4 360 and InstPeriod = 0 then begin InstPeriod = count; end; end; {It looks a little different from the first posting simply because I thought I could kind of Cliff Note it.} Bernie Deitrick wrote: Titanus, =100/5 +1 or =Int(A1/B1 + 1) where A1 has the amount, and B1 has the interest... But you would be much better off telling us what it is that you want to do.... There are lots of financial functions that can give answers to complex situations with a minimum of work. HTH, Bernie MS Excel MVP "Titanus" wrote in message oups.com... Can anyone tell me, since I'm a VBA-virgin, if this routine can be performed (and how) using just a regular Excel spreadsheet? Thanks so much! Sub titanus() Dim interest(50) Period = 0 valu = 0 For i = 1 To 50 interest(i) = 5 Next For Count = 1 To 50 valu = valu + interest(Count) If valu 100 And Period = 0 Then Period = Count End If Next End Sub |