Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
J J is offline
external usenet poster
 
Posts: 9
Default specific cell values in two ranges

I am trying to do is to take a set of investment returns
and a benchmark over the same time period and calculate
the investment's compound return when the benchmark was
up divided by the benchmark's compound return when the
benchmark was up. This will therefore measure the amount
of the upside that an investment is capturing of the
market.

Mathematically - it is easy to see at the following
website -
http://support.pertrac2000.com/statistics2000.asp
Click on the left side - up capture ratio under
benchmark ratios.

The problem has to do with creating a loop that can
compare CORRESPONDING values within two ranges (obviously
equally sized ranges).

The benchmark part of the calculation is easy as it is
calculating (1+BM) times itself for the length of the
range. The fund part of the calculation is more
difficult as it uses corresponding cells from both ranges
(1+invesment) for each time that the benchmark is up.

Here is what i have so far:

Public Function UPCAPTURE(FUNDRETURNS As RANGE, BMRETURNS
As RANGE) As Double
Dim FUNDAP As Double
Dim BMAP As Double
Dim FUNDRNGCELL As RANGE
Dim BMRNGCELL As RANGE

BMAP = 1
For Each BMRNGCELL In bmreturns
If BMRNGCELL.Value 0 Then
BMAP = BMAP * (1 + BMRNGCELL.Value)
End If
Next BMRNGCELL

'HERE IS THE PART I CAN'T FIGURE OUT:
FUNDAP = ????

UPCAPTURE = (FUNDAP - 1) / (BMAP - 1)
End Function

Thank you for the help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 280
Default specific cell values in two ranges

J,
I believe this captures the essence of the up capture. Check my work before
you take it to the bank.

Sub Test()
Dim i As Integer
Dim T As Double, TD As Double
Dim r1 As Range, r2 As Range
Set r1 = Range("A1", "A10")
Set r2 = Range("B1", "B10")
T = 1: TD = 1
For i = 1 To r1.Cells.Count
If r2(i) = 0 Then
T = T * (1 + r1(i))
TD = TD * (1 + r2(i))
End If
Next i
T = T - 1
TD = TD - 1
Debug.Print T
Debug.Print TD
Debug.Print T / TD
End Sub

Bob

"J" wrote in message
...
I am trying to do is to take a set of investment returns
and a benchmark over the same time period and calculate
the investment's compound return when the benchmark was
up divided by the benchmark's compound return when the
benchmark was up. This will therefore measure the amount
of the upside that an investment is capturing of the
market.

Mathematically - it is easy to see at the following
website -
http://support.pertrac2000.com/statistics2000.asp
Click on the left side - up capture ratio under
benchmark ratios.

The problem has to do with creating a loop that can
compare CORRESPONDING values within two ranges (obviously
equally sized ranges).

The benchmark part of the calculation is easy as it is
calculating (1+BM) times itself for the length of the
range. The fund part of the calculation is more
difficult as it uses corresponding cells from both ranges
(1+invesment) for each time that the benchmark is up.

Here is what i have so far:

Public Function UPCAPTURE(FUNDRETURNS As RANGE, BMRETURNS
As RANGE) As Double
Dim FUNDAP As Double
Dim BMAP As Double
Dim FUNDRNGCELL As RANGE
Dim BMRNGCELL As RANGE

BMAP = 1
For Each BMRNGCELL In bmreturns
If BMRNGCELL.Value 0 Then
BMAP = BMAP * (1 + BMRNGCELL.Value)
End If
Next BMRNGCELL

'HERE IS THE PART I CAN'T FIGURE OUT:
FUNDAP = ????

UPCAPTURE = (FUNDAP - 1) / (BMAP - 1)
End Function

Thank you for the help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 280
Default specific cell values in two ranges

Public Function UPCAPTURE(FUNDRETURNS As Range, BMRETURNS As Range) As
Double
Dim FUNDAP As Double
Dim BMAP As Double
Dim FUNDRNGCELL As Range
Dim BMRNGCELL As Range
Dim i As Long

BMAP = 1: FUNDAP = 1
For i = 1 To BMRETURNS.Cells.Count
If BMRETURNS(i).Value 0 Then
FUNDAP = FUNDAP * (1 + FUNDRETURNS(i).Value)
BMAP = BMAP * (1 + BMRETURNS(i).Value)
End If
Next i

UPCAPTURE = (FUNDAP - 1) / (BMAP - 1)
End Function

"J" wrote in message
...
I am trying to do is to take a set of investment returns
and a benchmark over the same time period and calculate
the investment's compound return when the benchmark was
up divided by the benchmark's compound return when the
benchmark was up. This will therefore measure the amount
of the upside that an investment is capturing of the
market.

Mathematically - it is easy to see at the following
website -
http://support.pertrac2000.com/statistics2000.asp
Click on the left side - up capture ratio under
benchmark ratios.

The problem has to do with creating a loop that can
compare CORRESPONDING values within two ranges (obviously
equally sized ranges).

The benchmark part of the calculation is easy as it is
calculating (1+BM) times itself for the length of the
range. The fund part of the calculation is more
difficult as it uses corresponding cells from both ranges
(1+invesment) for each time that the benchmark is up.

Here is what i have so far:

Public Function UPCAPTURE(FUNDRETURNS As RANGE, BMRETURNS
As RANGE) As Double
Dim FUNDAP As Double
Dim BMAP As Double
Dim FUNDRNGCELL As RANGE
Dim BMRNGCELL As RANGE

BMAP = 1
For Each BMRNGCELL In bmreturns
If BMRNGCELL.Value 0 Then
BMAP = BMAP * (1 + BMRNGCELL.Value)
End If
Next BMRNGCELL

'HERE IS THE PART I CAN'T FIGURE OUT:
FUNDAP = ????

UPCAPTURE = (FUNDAP - 1) / (BMAP - 1)
End Function

Thank you for the help.



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
Referencing Named Ranges using values in a cell eggman Excel Discussion (Misc queries) 2 September 23rd 06 06:30 PM
How can I password protect specific cell ranges in Excel? spanner Excel Discussion (Misc queries) 1 March 21st 06 01:14 AM
How to slot cell values into pre-defined ranges KDD Excel Discussion (Misc queries) 7 August 29th 05 03:34 PM
Specific cell values Nigel Excel Discussion (Misc queries) 3 August 26th 05 11:23 AM
Adding Cell Values to Ranges Mike R Excel Programming 2 August 1st 03 09:37 AM


All times are GMT +1. The time now is 02:07 AM.

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

About Us

"It's about Microsoft Excel"