Looking for value

XcelLearner

Board Regular
Joined
Feb 6, 2016
Messages
52
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi,

I have a value looking problem that is out of my depth, and would appreciate your help.

I have a data set in array L5:O28 as in the photo, with the return of each month. Investment B1 was first made in 6/30/2021 and therefore only captured the return since July 2021. I will have investment B2, B3, and so on as the array will expand, but let's keep it at L5:O28 at the moment.

I have a desired result array in Q5:T28 to report the monthly return of Investment B1. The month was recorded as 1 for Jan, 2 for Feb, etc. Any date before the Investment was made in 6/30/2021 should be returned as a blank like in the photo. What is the formula for that (cell S6), so that if I change the Investment to B2, it will change as well?

I use Office 365.

Thank you very much.


1676175827375.png
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I'm not quite clear on what you're asking. I get that you want Q5:T17 to reflect the investment specified in S4. What's confusing me is that Columns M and N are devoted to investment B1, but you have a single column O for investment B2. Don't you need for either investment a column for "return" and one for the investment value? Where are those two columns located for investment B2?
 
Upvote 0
I'm not quite clear on what you're asking. I get that you want Q5:T17 to reflect the investment specified in S4. What's confusing me is that Columns M and N are devoted to investment B1, but you have a single column O for investment B2. Don't you need for either investment a column for "return" and one for the investment value? Where are those two columns located for investment B2?
Thank you very much for your question. B1 and B2 are in a pool of investments, so as long as B2 is invested, they will share the same return. For example, if I made another investment in October 2021, the value of the investment will be reported in array O15:O31.

I revised my data table to add B2 values and transposed the desired table from Q5-T17 into Q5-AC9 as it allows better expansion.

1676184829732.png
 
Upvote 0
It would be very helpful, and get you faster responses, if you could provide the sample data in a form that we can copy/paste to test with. See XL2BB

See if this does what you want

23 02 12.xlsm
LMNOPQRST
4B1
5B1B2B3Month202020212022
631/01/2021-1%1  4%
728/02/20210%2  9%
831/03/2021-1%3  -5%
930/04/20214%4  -5%
1031/05/202111%5  13%
1130/06/20217%1006 7%3%
1231/07/2021-3%1017 -3%-5%
1331/08/2021-1%1028 -1%3%
1430/09/2021-1%1032009 -1%7%
1531/10/20214%10420110 4% 
1630/11/20218%10520211 8% 
1731/12/202111%10620312 11% 
1831/01/20224%107204
1928/02/20229%108205
2031/03/2022-5%109206305
2130/04/2022-5%110207306
2231/05/202213%111208307
2330/06/20223%112209308
2431/07/2022-5%113210309
2531/08/20223%114211310
2630/09/20227%115212311
Investment
Cell Formulas
RangeFormula
R6:T17R6=LET(rw,MATCH(EOMONTH(DATE(R$5,$Q6,1),0),$L$6:$L$26,0),v,IFNA(INDEX($N$6:$P$26,rw,MATCH($S$4,$N$5:$P$5,0)),""),IF(v="","",INDEX($M$6:$M$26,rw)))


If I change S4 to B3:

23 02 12.xlsm
LMNOPQRST
4B3
5B1B2B3Month202020212022
631/01/2021-1%1   
728/02/20210%2   
831/03/2021-1%3  -5%
930/04/20214%4  -5%
1031/05/202111%5  13%
1130/06/20217%1006  3%
1231/07/2021-3%1017  -5%
1331/08/2021-1%1028  3%
1430/09/2021-1%1032009  7%
1531/10/20214%10420110   
1630/11/20218%10520211   
1731/12/202111%10620312   
1831/01/20224%107204
1928/02/20229%108205
2031/03/2022-5%109206305
2130/04/2022-5%110207306
2231/05/202213%111208307
2330/06/20223%112209308
2431/07/2022-5%113210309
2531/08/20223%114211310
2630/09/20227%115212311
Investment
Cell Formulas
RangeFormula
R6:T17R6=LET(rw,MATCH(EOMONTH(DATE(R$5,$Q6,1),0),$L$6:$L$26,0),v,IFNA(INDEX($N$6:$P$26,rw,MATCH($S$4,$N$5:$P$5,0)),""),IF(v="","",INDEX($M$6:$M$26,rw)))
 
Upvote 0
Hi Peter,

Thank you very much for your help. Yes, I installed the Add-in as suggested, and will use it next time.
I would like to have a few tweaks if you could help:

1. In your first example with B1, the first value of it in column N is in June 2021, so the desired result will show first return in July 2021 of -3% (and June 2021 of being blank). The reason is: if I add new investment on 6/30/2021, the first month of having a return will be the next month, which is July. So basically, can you formula delay the result by a month?

2. Can you please transpose the result if possible? Rather the months are stored in rows, they are in columns, like this:

1676197644665.png



Always appreciate your kind help.
Best regards,
 
Upvote 0
Try this

23 02 12.xlsm
LMNOPQWXYZAAABACADAEAFAGAHAI
3B1
4Month123456789101112
5B1B2B32020            
631/01/2021-1%2021      -3%-1%-1%4%8%11%
728/02/20210%20224%9%-5%-5%13%3%-5%3%7%   
831/03/2021-1%
930/04/20214%
1031/05/202111%
1130/06/20217%100
1231/07/2021-3%101
1331/08/2021-1%102
1430/09/2021-1%103200
1531/10/20214%104201
1630/11/20218%105202
1731/12/202111%106203
1831/01/20224%107204
1928/02/20229%108205
2031/03/2022-5%109206305
2130/04/2022-5%110207306
2231/05/202213%111208307
2330/06/20223%112209308
2431/07/2022-5%113210309
2531/08/20223%114211310
2630/09/20227%115212311
Investment (2)
Cell Formulas
RangeFormula
X5:AI7X5=LET(eom,DATE($W5,X$4+1,0),rw,MATCH(eom,$L$6:$L$26,0),v,IF(eom=XLOOKUP(0,FILTER($N$6:$P$26,$N$5:$P$5=$W$3),$L$6:$L$26,"",1),"",IFNA(INDEX($N$6:$P$26,rw,MATCH($W$3,$N$5:$P$5,0)),"")),IF(v="","",INDEX($M$6:$M$26,rw)))
 
Upvote 1
Solution
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,214,810
Messages
6,121,690
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top