YTD return for a moving range.

MarcJohn

New Member
Joined
Jun 2, 2014
Messages
28
I have a moving date range (changes daily) that I would like to compute a YTD return for. How should I lock my reference point as the first day of the year so that as the dates push down the spreadsheet the YTD return is still truly YTD?

Time/DateYieldCHG
=Now0.375-0.002
Trading day before0.3770.01
Trading day before....0.3670.02
.....0.3460.002
.....0.344-0.001
.....0.3450.004
....0.3410.004
....and so on, until...0.337....
First day of year0.382

<tbody>
</tbody>

I hope this clearly explains what I'm trying to do.

Thanks
 
Hi MarcJohn,
So each day you insert a row at the top with the current days data? I am still new to Excel too and would like to know how to do this as well.
Thanks!
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
No, I do not add a new row. My data is feed into excel via a Bloomberg add-in. It has formulas that do this automatically.
 
Upvote 0
Here is a working example:


Excel 2010
ABCDE
1Date/TimeLast YieldCHNGYTD returnYour return
2Jun-020.3940.0190.0490.366125
3May-300.375-0.002
4May-290.3770.01
5May-280.3670.021
6May-270.3460.002
7May-260.3440
8May-230.344-0.001
9Jan-010.382...
10Dec-311000010000
Sheet1
Cell Formulas
RangeFormula
D2=SUM(C2:INDEX(C:C,MATCH(DATE(YEAR(A2),1,1),A:A,-1)))
E2=AVERAGE(B2:INDEX(B:B,MATCH(DATE(YEAR(A2),1,1),A:A,-1)))
 
Upvote 0
This does not work. The =Sum formula and the =Average formula you gave me give me the return for the entire columns. I only need the return from the start of the year (but need the prior data for other purposes).
 
Last edited:
Upvote 0
I don't know why you think it doesn't work. You can see from my example that the data for 31 Dec is excluded (I made those numbers large deliberately).
 
Upvote 0
I don't know why you think it works. The formula you have above tracks the change for the entire column. I need a formula that tracks the change from 1/1/14. I cant just delete all of the info below 1/1/14 because I need it for other formulas. And I cant just select the cell that 1/1/14 is in today because it automatically moves down one row everyday. I need a formula that locks on the that specific date and tracks the changes from that date to the present date.

Your formula does not do that. The return your formula gives me is -0.349162, which is the exact number that =SUM(of the entire CHG column) gives me (which dates back 4+ years). The return I am looking for is 0.004838, which is =SUM(of CHG from today to 1/1/14).
 
Upvote 0
I say it works because my formula clearly isn't using the entire column. It stops at 1/1/14.

Can you put your workbook on a share like Box.net and post the URL? Maybe you don't have serial dates in column A.
 
Upvote 0
I removed the errors. This formula:

=SUM(H3:INDEX(H:H,MATCH(DATE(YEAR(B3),1,1),B:B,-1)))

sums from H3:H112 (B112 contains 01/01/2104). Isn't that what you want?
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,668
Members
449,463
Latest member
Jojomen56

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