function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pavlo ShchurPavlo Shchur 

How to count days between CreatedDate of Account and Birthdate of Contact within one year. The code below loses 3 days.

ABS(
IF( NOT( ISBLANK( Birthdate ) ) ,
  IF( DATE( 2000 , MONTH( Birthdate ) , DAY( Birthdate ) ) <= 
      DATE( 2000 , MONTH( TODAY() ) , DAY( TODAY() ) ),

      FLOOR(
        (Birthdate - DATEVALUE(Account.CreatedDate)) -
         FLOOR(
         (Birthdate - DATEVALUE(Account.CreatedDate)) / 365.25
              )
      * 365.25
),

      FLOOR(
        (Birthdate - DATEVALUE(Account.CreatedDate)) -
         FLOOR(
         (Birthdate - DATEVALUE(Account.CreatedDate)) / 365.25
              )
      * 365.25
           )
),
  null)
)