I have a table of Mutual Fund net asset values (NAVs) on a daily basis, called “Equity_Adj_NAV in my Access 2013 database. This table had the following fields:
Code- Each Fund has a unique code
NAV Date- The date on which the NAV is recorded
NAV- the value of the fund on that day.
A sample trunctated table in Excel 97-2003 format is attached herewith.
I want to capture 1-year returns for each fund on any date, for further use in performance analysis.
I used the following query, and it worked very well:
However, there are some places where the exact “Date+365” will not work- due to holidays or non-business days, we may get a match for dates from 355 to 365 days.
In Excel, we work around this using the “TRUE” criterion in a VLOOKUP formula. Is there any way to get the nearest approximate 365-day date and compute the return, where the exact 365-day date is not available in the data?
Also, the main table has over 300 codes and 700,000 rows; the attachment is only a sub-set with 10 codes and 24,000 rows. So any solution would need to take cognizance of the table size.
Code- Each Fund has a unique code
NAV Date- The date on which the NAV is recorded
NAV- the value of the fund on that day.
A sample trunctated table in Excel 97-2003 format is attached herewith.
I want to capture 1-year returns for each fund on any date, for further use in performance analysis.
I used the following query, and it worked very well:
Code:
SELECT Equity_Adj_NAV.Code, Equity_Adj_NAV.[NAV Date], Equity_Adj_NAV.NAV AS NAV1, Equity_Adj_NAV_1.NAV AS NAV2, [NAV2]/[NAV1]-1 AS Return
FROM Equity_Adj_NAV AS Equity_Adj_NAV_1 INNER JOIN Equity_Adj_NAV ON Equity_Adj_NAV_1.Code = Equity_Adj_NAV.Code
WHERE (([Equity_Adj_NAV_1].[NAV Date]=[Equity_Adj_NAV].[NAV Date]+365));
However, there are some places where the exact “Date+365” will not work- due to holidays or non-business days, we may get a match for dates from 355 to 365 days.
In Excel, we work around this using the “TRUE” criterion in a VLOOKUP formula. Is there any way to get the nearest approximate 365-day date and compute the return, where the exact 365-day date is not available in the data?
Also, the main table has over 300 codes and 700,000 rows; the attachment is only a sub-set with 10 codes and 24,000 rows. So any solution would need to take cognizance of the table size.