Forum Discussion
Excel Formula help needed please
Hi Sian,
I actually had a fun hour working this out (BING is your friend)..
Formatting is UK based but this should be enough to help you work it out..
As for the first part you didn't provide information about exactly what you wanted but use the DATEDIF function - everything you need is here:
https://support.office.com/en-us/article/calculate-the-difference-between-two-dates-8235e7c9-b430-44ca-9425-46100a162f38
The key to the formatting question is calculating the review date. I guess you are looking for something like this
The key formula is the Review date which had to take account of the fact that if a date was in the past we needed to increment the year by one so you were always looking at the next review..
I used this formula - I am not an Excel expert so there may be a more subtle and elegant way to achieve this.. but hopefully enough to get you started.. Use the DATE function to construct a date. For cell C4
=IF(MONTH(B4)>MONTH(NOW()),DATE(YEAR(NOW()), MONTH(B4),DAY(B4)),DATE(YEAR(NOW()) +1, MONTH(B4),DAY(B4)))
I also used NOW() formula for the current date, you may want to put a 'Review date' into a cell and refer to that instead so the calculation is fixed based on the 'Review Date'
The conditional formatting rules were as follows
Hope that helps,
Andrew
Thank you so much. I've literally just managed to sort the length of service bit out. and will definitely have a look at the second part now.
I'm in the UK so UK based is perfect for me! I think the problem was that i'd put the dates in in 01.01.13 instead of 01/01/13 which was causing a lot of the problems.
Thanks again for a quick response
- AnonymousJul 01, 2018
No problem - you need to make sure your cells are formatted as Short Date too.. otherwise calculations return an integer - good luck,
Andrew