Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Counter variable and a multiplier

Hello,

I am building a procedure a piece at a time and would appreciate some
help tweaking some old code that was given me. Here is the old code:

Option Explicit

Function CalcI3(mylocation As Range) As Single
Application.Volatile
Dim LC As Integer

If IsEmpty(mylocation.Offset(0, 1)) Then
Exit Function
ElseIf mylocation.Offset(0, 1) < 1 Then
Exit Function
End If
'initialize
CalcI3 = 0
For LC = 0 To mylocation.Offset(0, 1) - 1
CalcI3 = CalcI3 + mylocation.Offset(-LC, -1)
Next
End Function


How do I substitute CalcI3 for NUM when NUM is:

NUM = NUM + (1+ count) * (Price[count])

Here is the data table in part:

Price Num Period (count)

5.29 1
5.34 4
5.31 4
5.25 7
5.20 9
5.23 11
5.32 12
5.38 14


The different thing I am trying to do here is multiply price with the
counter. What else do I have to add to the code to do this? I tried
just putting a (*) but did not get the proper result.

I would just like to enter NUM as a function into its column.

Thanks,
LenS

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default Counter variable and a multiplier

On Feb 23, 6:45 am, "LenS" wrote:
Hello,

I am building a procedure a piece at a time and would appreciate some
help tweaking some old code that was given me. Here is the old code:

Option Explicit

Function CalcI3(mylocation As Range) As Single
Application.Volatile
Dim LC As Integer

If IsEmpty(mylocation.Offset(0, 1)) Then
Exit Function
ElseIf mylocation.Offset(0, 1) < 1 Then
Exit Function
End If
'initialize
CalcI3 = 0
For LC = 0 To mylocation.Offset(0, 1) - 1
CalcI3 = CalcI3 + mylocation.Offset(-LC, -1)
Next
End Function

How do I substitute CalcI3 for NUM when NUM is:

NUM = NUM + (1+ count) * (Price[count])

Here is the data table in part:

Price Num Period (count)

5.29 1
5.34 4
5.31 4
5.25 7
5.20 9
5.23 11
5.32 12
5.38 14

The different thing I am trying to do here is multiply price with the
counter. What else do I have to add to the code to do this? I tried
just putting a (*) but did not get the proper result.

I would just like to enter NUM as a function into its column.

Thanks,
LenS


The numbers for Period slipped over to NUM when I posted. NUM should
be blank.
LenS

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to create a repeat formula using the same multiplier? Lisa Excel Worksheet Functions 2 August 8th 06 03:15 AM
counter Haza Excel Discussion (Misc queries) 2 January 20th 06 08:30 PM
Counter Sdbenn90 Excel Discussion (Misc queries) 4 January 9th 06 11:43 AM
Use a multiplier to change List Prices to Net prices Dangada Excel Worksheet Functions 1 July 6th 05 06:31 AM
Counter Polina Excel Discussion (Misc queries) 2 May 27th 05 09:52 PM


All times are GMT +1. The time now is 04:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"