Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date Calculation Error #76

Closed
GeekStewie opened this issue Aug 17, 2022 · 1 comment · Fixed by #82
Closed

Date Calculation Error #76

GeekStewie opened this issue Aug 17, 2022 · 1 comment · Fixed by #82
Assignees
Labels
bug Something isn't working
Milestone

Comments

@GeekStewie
Copy link
Collaborator

Calculated Age is wonky with some dates. I checked the formula and I can see why (365 day years and 30 day months not always the case) but I also know age cals are a nightmare to get right, as it depends on how an organisation defines their month and day calcs (could vary). Maybe a decimal years-only value would be easier to deal with?

Test data if you need it:
DOB = 10th August 2021 shows 1 YEARS 0 MONTHS 0 DAYS
DOB = 11th August 2021 shows 0 YEARS 12 MONTHS 4 DAYS
…same pattern for a few days, reducing day count…
DOB = 15th August 2021 shows 0 YEARS 12 MONTHS 0 DAYS
DOB = 16th August 2021 shows 0 YEARS 11 MONTHS 29 DAYS

@GeekStewie GeekStewie added the bug Something isn't working label Aug 17, 2022
@GeekStewie GeekStewie self-assigned this Aug 17, 2022
@GeekStewie GeekStewie added this to the Winter 23 milestone Aug 17, 2022
@cjrolfe
Copy link
Collaborator

cjrolfe commented Aug 19, 2022

Could try the following to account for Leap Years

IF(ISBLANK(Date_of_Birth__c), Estimated_Age__c, FLOOR((TODAY()-Date_of_Birth__c +1)/365.2425))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants