Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
W W is offline
external usenet poster
 
Posts: 35
Default Any Way To Specify XIRR Values and Dates Without Using Array?

Let's say I have a schedule of cash flows and dates that I want to make
calculations of the internal rate of return. But I don't have the data
organized in a way that lets me specify the cell range of the values or the
cell range of the dates. Instead I need to explicitly name individual
cells in the series. Is there a way for me to do this in the XIRR
function? If not, what is a better alternative to XIRR that lets me name
discrete cells for values and dates in the time series?

--
W


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 829
Default Any Way To Specify XIRR Values and Dates Without Using Array?


"W" wrote:
Let's say I have a schedule of cash flows and dates that I want to make
calculations of the internal rate of return. But I don't have the data
organized in a way that lets me specify the cell range of the values or
the
cell range of the dates. Instead I need to explicitly name individual
cells in the series. Is there a way for me to do this in the XIRR
function? If not, what is a better alternative to XIRR that lets me name
discrete cells for values and dates in the time series?


I think you want syntax like the following:

=myxirr((E1:G1,I3:I5,K7,G8),(E11:E12,G14:H14,C17,E 19,J16,K12))

XIRR does not support that syntax. But the following VBA function does.

To enter the VBA function, right-click on the worksheet tab and click on
View Code, which opens the VBA window. In the VBA window, click on Insert,
then Module. Copy the following text and paste into the module editing
pane.

Function myxirr(v, d, Optional g As Double = 0.1)
Dim nv As Long, i As Long, a, c
nv = v.Count
ReDim vval(1 To nv) As Double, dval(1 To nv) As Double
i = 0
For Each a In Split(v.Address, ","): For Each c In Range(a)
i = i + 1
vval(i) = c.Value
Next c, a
i = 0
For Each a In Split(d.Address, ","): For Each c In Range(a)
i = i + 1
dval(i) = c.Value
Next c, a
myxirr = Application.Xirr(vval, dval, g)
End Function

The function assumes that v.Count = d.Count.

Using Application.Xirr instead of WorksheetFunction.Xirr allows any Xirr
error (typically #NUM) to be returned instead of a #VALUE error.

If you use Excel 2003 or earlier, you will need to access the Xirr function
differently. Let us know if need help with that.

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
Cell values to an array, then array transpose to another workbook L. Howard Excel Programming 8 January 16th 14 09:30 PM
Can XIRR Work on Dates That Move Backwards in Time? W Excel Worksheet Functions 3 January 9th 13 08:50 AM
Using XIRR in an array formula James Buist Excel Worksheet Functions 9 October 16th 09 05:22 PM
Array: Counting multiple values within array Trilux_nogo Excel Worksheet Functions 4 April 16th 07 03:12 AM
search an array for values contained in another array Cheer-Phil-ly Excel Programming 0 April 12th 07 09:44 PM


All times are GMT +1. The time now is 01:47 PM.

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"