动态构造要在XIRR公式中使用的范围 [英] Dynamically construct range to use in XIRR formula

查看:36
本文介绍了动态构造要在XIRR公式中使用的范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张这样的床单:

Fund | Date      | Amount
A    | 10-Jan-05 | -5000
A    | 10-Feb-05 | -5000
A    | 08-Oct-13 | 12500
B    | 10-Sep-05 | -5000
B    | 10-Oct-05 | -5000
B    | 10-Nov-05 | -5000
B    | 08-Oct-13 | 22500

我正在寻找一个输出列,该列提供每种基金的XIRR.XIRR函数将值和日期作为范围.我需要一种使用基金名称作为搜索条件来动态构建范围的方法.

I'm looking for an output column that provides the XIRR for each fund. The XIRR function takes values and dates as ranges. I need a way to dynamically construct the range using the fund name as a search criteria.

Fund | XIRR
A    | ...
B    | ...

我可以按名称对每个基金的范围进行手动指定,但不是可扩展的解决方案.

I could manually specify the range for each fund after sorting it by name, but its not a scalable solution.

推荐答案

您可以使用OFFSET获取正确的范围,例如这个公式

You can use OFFSET to get the correct ranges, e.g. this formula

= XIRR(OFFSET(C $ 2,MATCH(A11,A $ 2:A $ 8,0)-1,0,COUNTIF(A $ 2:A $ 8,A11)),OFFSET(B $ 2,MATCH(A11,A $ 2:A $ 8,0)-1,0,COUNTIF(A $ 2:A $ 8,A11)))

查看屏幕截图

这篇关于动态构造要在XIRR公式中使用的范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆