Dynamic Date To Track The Maturity Date of Automatic Rollover Deposit - excel

Suppose that I open an automatic rollover time deposit (ARO TD) account in a bank on January 17, 2017 (the value date). The funds in this account must be held for 3 months (the tenor). Since it's an ARO TD, the maturity date will be automatically renewed with no action required by me if I choose to do nothing. Today's date is July 18, 2017. So, my account will mature on October 17, 2017. If I open it on January 19, 2017, it will mature on July 19, 2017, and so on.
How do I track the maturity date of my account in Excel with only using inputs: deposit period and value date? Meaning, the maturity date will continually update to the next period each time it matures. I'm able to find the Excel formula for this:
=IF(EDATE(B2,A2*CEILING(DATEDIF(B2,TODAY(),"M")/A2,1))<TODAY(),EDATE(B2,A2*(1+CEILING(DATEDIF(B2,TODAY(),"M")/A2,1))),EDATE(B2,A2*CEILING(DATEDIF(B2,TODAY(),"M")/A2,1)))
The above formula works perfectly but it's too long. Could anyone here come up with a nicer and shorter formula than this?

You can use the DATEDIF function to do this. For reasons I don't understand, Excel doesn't suggest it when you're typing, but it exists and is documented.
DATEDIF is useful because you're interested in the number of months between dates. The earlier date of interest is the value date; the later date is today (actually yesterday, because as in your first example you want the date to tick on on the expiry date).
Once you have this number of months, you can get the exact number of tenors that is, add one, and then add that many months to the value date.
A formula is actually easier than the above text!
Your C2 cell should be:
=EDATE(B2, A2 * (FLOOR( DATEDIF(B2, TODAY()-1, "m") / A2, 1) + 1))
Working outwards from the middle, the DATEDIF gets the number of months from the value date to yesterday, we divide it by the tenor and floor to get the number of tenor periods that have passed, we add one to get the target number of tenor periods, we multiple by the tenor to get the number of months to add, then finally EDATE does the month-adding.
The result will be a date serial (eg 43025) so will need appropriate cell formatting.

Related

Dynamic update based on today's date

I have the following table
Payments left is calculated by matching the first occurrence of value zero and returning the index of that row (I am subtracting 2 because first payment is on row 2).
This works now because first payment is on June 1, 2020 but If I open this spreadsheet 3 months from now it will still say payments left 15. That will not be correct anymore since at that time 3 payments are made so should say payment left 12.
Is there any way to dynamically know at what row should the calculation of "Payments left" start.
With other words if today is August 15 2020 (I can manually enter today's date if needed), then calculating Payments left should start from September 1, 2020 until the end.
After playing a little bit around I was able to accomplish that with this formula:
where Last Payment Sent is: =DATE(YEAR(TODAY()),MONTH(TODAY()),1)
DATEDIF() function returns the time period between 2 to dates in the units specified.
You can keep today's day in one cell with the TODAY() function, and sum in your formula
the index of the table plus the months elapsed since the last payment.
Pesudocode example would be:
your formula + DATEDIF(LastpaymentCellAddress; TODAY()StoredCellAddress, "m")
The third argument "m" is to return the time elapsed in months.
https://support.office.com/en-us/article/calculate-the-difference-between-two-dates-8235e7c9-b430-44ca-9425-46100a162f38
Take into account that the dates in the arguments must follow an order fo the function to work, and the smaller date goes first. It is time from-to function.
Hope that helps
This should do the trick:
=COUNTIFS($A:$A,">"&TODAY())

Compare two week numbers from different years in Excel

I have some calculations that are strongly dependent on "this week", "next week", etc.
Let's say I have a date (Column A). I can use WEEKNUM((A1), 2) in Column B to get the week number.
In Column C, I can enter this formula to check if the event is this week or next week.
=IF(B1=WEEKNUM((TODAY()),2),"this week",IF(B1=WEEKNUM((TODAY()+7),2),"next week","way in the future"))
This all works great until I have events that cross into next year. So December 31, 2019, will be week 53 and December 31, 2020, will be week 53.
This is an issue because I need a way to account that December 31, 2020 happens later than December 31, 2019.
How do I account for change in years in this formula?
Update:
Adding YEAR as an additional condition will allow me to compare if the date HAS a different year but it still won't let me dynamically calculate, this week, next week.
In this second example, I set two dates and set my computer time as December 31 2019. The result is that instead of reporting 1/1/2020 as "next week" the formula returns "way in the future" which is incorrect.
Is there basically a way to subtract or add weeks using serial week number since epoch time?
Eh, I think I figured it out. Instead of comparing week numbers, we extract the Monday of each week and perform a similar comparison like before. Except we now have the entire date instead of just the week number.
=IF(A2-MOD(A2-2,7)=TODAY()-MOD(TODAY()-2,7),"this week",IF(A2-MOD(A2-2,7)=TODAY()-MOD(TODAY()-2,7)+7,"next week","way in the future"))

Excel Date Formatting is Being Changed from Date to General on Moblie Preview

So we have a weekly report that gets sent out. In the report there are dates assigned to production numbers and for some reason when previewed from a mobile device the dates are changed to integers. 43028 is October 20, 2017. I have no idea where this number is coming from, because this goes back to December 30, 1899. I have no idea why it's switching into this form and only on mobile devices.
This is how excel handles dates. The integer represents a count from a set date (you can enter 0 into a cell and format it as a date to find the starting date). Every +1 represents the next day from that starting point. Your decimals represent hours (.5 = half day).
You can try a helper column and set it equal to your date using =TEXT(A2,"m/dd/yyyy") where A2 is your current date. Date format can be adjusted to taste.

Using a dynamic single formula to calculate a date

This is a follow up to an earlier question.
#ForwardED I am trying to convert your original single static formula into a single dynamic formula.
Unfortunately my employer's filters will let me up certain things to a hyperlink, but will not let me download or view from the same site. I am also trying to come up with a formula for floating dates.
Below is a copy of the expanded explanation I gave on the original question. I am not sure if you missed it or not. It deals with holidays that have a set date like Christmas, 25th of December of every year. However if it fall on a Saturday the time of work is the Friday and if it is on a Sunday the day off is the Monday.
Dealing with a holiday falling on a Saturday or Sunday
Again we need to refer to some cell in your spreadsheet with the year so I will again use Q10 as the example and we will assume a date of 2014/10/24.
=IF(WEEKDAY(DATE(YEAR(Q10),12,25))=7,DATE(YEAR(Q10),12,24),IF(WEEKDAY(DATE(YEAR(Q10),12,25))=1,DATE(YEAR(Q10),12,26),DATE(YEAR(Q10),12,25)))
The formula checks first if the weekday is a Saturday. We do this using a function that will return the day of the week See step 2) from the original question. It is this part from the equation above:
WEEKDAY(DATE(YEAR(Q10),12,25))
It will return a single integer 1 through 7 corresponding to the day of the week the date function results in, in this case. If its a 1 we known its Sunday, if its 7 we know its Saturday. So the check for Saturday is:
WEEKDAY(DATE(YEAR(Q10),12,25))=7
If WEEKDAY()=7 is true then we provides the date of the day before which is really just subtracting 1 from the date we were looking at. We use this part of the formula to calculate that:
DATE(YEAR(Q10),12,24)
notice how I changed the day from 25 to 24. An alternate way would be to recycle our date and make the computer do one more calculation using this formula:
DATE(YEAR(Q10),12,25)-1
or
DATE(YEAR(Q10),12,25-1)
That all sits in the TRUE portion of the if statement. so if the date does not fall on Saturday then we wind up in the FLASE portion of the IF statement. Here we check with a second IF for the date falling on a Sunday. we use the same theory and process as we did for the Saturday check.
IF(WEEKDAY(DATE(YEAR(Q10),12,25))=1,DATE(YEAR(Q10),12,26),DATE(YEAR(Q10),12,25))
Placing an IF statement inside an IF statement is commonly referred to as "nesting". This whole IF statement happens in the FALSE portion of the previous IF that checked to see if it was Saturday. This time we checked for Sunday:
WEEKDAY(DATE(YEAR(Q10),12,25))=1
When this is true, then we need to increase the date by 1 day instead of decreasing it like was done for Saturday:
DATE(YEAR(Q10),12,26)
or
DATE(YEAR(Q10),12,25)+1
or
DATE(YEAR(Q10),12,25+1)
So that was the true portion of the Sunday check. Logically speaking the only way to get to the FALSE portion of this nested IF statement is to fail the Saturday check and then fail the Sunday check. Which means you do not need to go through and check if is the WEEKDAY comes out as 2, 3, 4, 5 or 6! Its one of those by the process of eliminating Sunday and Saturday (1 and 7). And if the date falls on Monday-Friday we dont need to change the date and can leave it just as is:
DATE(YEAR(Q10),12,25)
And I realized I did not explain how the date function works, though I think I tried to in one of the previous questions...regardless! DATE(arg1,arg2,arg3) requires three different arguments as integers or other functions that return integers.
arg1 is the year so 2014, 1995, 1965 are all acceptable integers. Also we could use YEAR(Q10), where the cell Q10 holds the date of 2014/10/24. In this case YEAR(Q10) would return 2014.
arg2 is the month and needs to be an integer in the range of 1 to 12. Again you can always use a formula that returns an integer in that range as well such as MONTH(Q10) which from our previous value of Q10 would return 10.
arg3 is day and similar to the above it needs to be an integer. A formula such as DAY(Q10) would return a value of 24.
What this means is if we know what day a holiday is on we can force it to a date by supplying a set month and day, and letting the year be determined by a formula that supplies the year you are interested in. So if you look at the last formula you can see we fixed the month at 12 and the day at 25. They year will be determine from the year of the date supplied in cell Q10.

Excel - Times a month and day occur between 2 dates

I have an Excel sheet where someone types in the date for a yearly bill. I need to know how many times we need to pay that bill between 2 dates.
For example if a bill is due every year on May 31st, the user will type in 5/31/2014. I need to know how many time we will pay that bill between 5/15/2014 and 5/15/2018. (The between dates will change). I can't just take the number of years between the start and end dates because in the example above the start and end dates could be 6/1/2014 and 5/30/2018, in which case I only have to pay the bill in 2015, 2016, and 2017, which makes 3 times.
I have this formula which calculates the number of times a certain day occurs between 2 dates: SUMPRODUCT(--(DAY(ROW(INDIRECT($Q$2&":"&$R$2)))=F4))(Q2 is the begin date, R2 is the end date, and F4 has the day of the month) But I can't figure out how to get this to work for a month and day.
Assuming the specific date in G4 you can use this version
=SUMPRODUCT(--(TEXT(ROW(INDIRECT($Q$2&":"&$R$2)),"ddmmm")=TEXT(G4,"ddmmm")))

Resources