View Single Post
  #3   Report Post  
bj
 
Posts: n/a
Default

I don't know why it would give you today??
If every day is present It will give you 5 years ago, but if every date is
not present, it would give you the last date before the 5 years ago date.

I would add a ",false" to the end of your lookup formula. this would make
it give only the 5 year ago date or an error if not present.
I am not sure what you mean by "next one" if you mean ten years ago try
=if(iserror(VLOOKUP(DATE(YEAR(NOW())-5;MONTH(NOW());DAY(NOW()));$A:$A;1,False)),VLOOKUP (DATE(YEAR(NOW())-10;MONTH(NOW());DAY(NOW()));$A:$A;1,False),VLOOKUP (DATE(YEAR(NOW())-5;MONTH(NOW());DAY(NOW()));$A:$A;1,False))




"Tsjah" wrote:

I use the following function(s) in a list of dates (ascending, obviously) to

=VLOOKUP(DATE(YEAR(NOW())-5;MONTH(NOW());DAY(NOW()));$A:$A;1)

This gives me either today, or the last occurance of the same day 5 years
ago if today is not available. I know what causes this, but can anybody give
me a not too complicated formula for getting the next one?

Thanks a lot!

Mike