View Single Post
Don Plumley Don Plumley is offline
Moderator
 
Don Plumley's Avatar
 
Join Date: Jun 2001
Location: Geyserville, CA
Posts: 6,921
Garage
Here, I'll post the formulas:

offset_date = cell where you enter the number of future years, could be zero, could be 5, etc.

offset is "=(TODAY()+(offset_date*365))"

service is "(offset-D8)/365" where D8 is the relative cell for date of hire

too_old is "=IF((offset-E8)/365<=60,0,-999)" where E8 is the relative cell for the date of birth

service sort is service + too_old

Sort on "service sort"

Unfortunately, it does not take leap years into account. I'll have to work on that...

__________________
Don Plumley
M235i
memories: 87 911, 96 993, 13 Cayenne
Old 03-14-2006, 08:29 PM
  Pelican Parts Catalog | Tech Articles | Promos & Specials    Reply With Quote #27 (permalink)