how to date based on values