I have an Excel spreadsheed like the one shown below
A B
10.02.2007 10
10.03.2007 12
Column A is date and B is price of share
Now my task is calculate financial return of share using formula
return = ln(price_today / price_yesterday)
Now in another sreadsheet I need to create a new column called Return In this column i need to place formula like = ln(B2/B1)
but on condition that this formula is only applied date in column A is in range StartDate < currentDate < EndDate
.
So I want to
Please suggest
To reference a cell in another workbook you need to use something like
[Book1.xlsx]Sheet1!$A$1
To find the year number you need to ensure that the column is a valid Date column, and use something like
=IF(YEAR([Book1.xlsx]Sheet1!$A$1) = 2007,LN([Book1.xlsx]Sheet1!$B$2/[Book1.xlsx]Sheet1!$B$1), 0)
And also maybe Excel: And Function to allow for the StartDate < currentDate < EndDate
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.