xirr

Including a non-adjacent cell in a Range (series) in the XIRR formula

时光怂恿深爱的人放手 提交于 2021-02-07 06:24:07
问题 I am using the XIRR formula as follows: =XIRR(E$11:E17,B$11:B17) but need to add an additional non-adjacent cell to the Range of values and dates. My first attempt: =XIRR((E$11:E17,H17),(B$11:B17,B17)) resulted in #VALUE I have attempted to do it using the CHOOSE function as follows: =XIRR(CHOOSE({1,2},E$11:E17,H17),CHOOSE({1,2},B$11:B17,B17)) But this is not working to produce the correct results. I cannot figure out how to add one cell onto the end of the range. The following did work to

XIRR Calc in SQL

一笑奈何 提交于 2020-01-23 19:55:47
问题 I'm trying to find a decent implementation of excels XIRR calculation in SQL. I found the following function online: CREATE TYPE dbo.MyXirrTable AS TABLE ( theValue DECIMAL(19, 9) NOT NULL, theDate DATETIME NOT NULL ) GO CREATE FUNCTION dbo.XIRR ( @Sample MyXirrTable READONLY, @Rate DECIMAL(19, 9) = 0.1 ) RETURNS DECIMAL(38, 9) AS BEGIN DECLARE @LastRate DECIMAL(19, 9), @RateStep DECIMAL(19, 9) = 0.1, @Residual DECIMAL(19, 9) = 10, @LastResidual DECIMAL(19, 9) = 1, @i TINYINT = 0 IF @Rate IS

java program to calculate XIRR without using excel or any other library

余生长醉 提交于 2019-12-21 05:56:19
问题 My application have to calculate XIRR, but I cannot use excel, because it runs on Linux, can any one share the logic or java code to calculate XIRR without using excel. 回答1: as stated in the post : xirr-calculation in c# According to XIRR function openoffice documentation (formula is same as in excel) you need to solve for XIRR variable in the following f(xirr) equation: xirr equation I just traduce the C# code in Java and it work well without any sup libraries. Even for date difference. But

Improving loop performance with function call inside

元气小坏坏 提交于 2019-12-08 06:45:22
问题 library(plyr); library(sqldf); library(data.table) library(stringi); library(RODBC); dbhandle <- odbcDriverConnect('driver={SQL Server};server=.;database=TEST_DB;trusted_connection=true') res <- sqlQuery(dbhandle, 'Select Company_ID, AsOfDate, CashFlow FROM dbo.Accounts') resdatatable = as.data.table(res) odbcCloseAll(); sppv <- function(i, n) { return((1 + i / 100) ^ (-n)) } npv <- function(x, i) { npv = c() for (k in 1:length(i)) { pvs = x * sppv(i[k], 1:length(x)) npv = c(npv, sum(pvs)) }

java program to calculate XIRR without using excel or any other library

我只是一个虾纸丫 提交于 2019-12-03 22:20:09
My application have to calculate XIRR, but I cannot use excel, because it runs on Linux, can any one share the logic or java code to calculate XIRR without using excel. Doukya as stated in the post : xirr-calculation in c# According to XIRR function openoffice documentation (formula is same as in excel) you need to solve for XIRR variable in the following f(xirr) equation: xirr equation I just traduce the C# code in Java and it work well without any sup libraries. Even for date difference. But in production code, you will use something like apache common. import java.text.ParseException;