CUSTOM FUNCTİON
Function Name
#Age (Diyez işareti koymamın sebebi en üste çıkması)
Function Parameters
-Birth -TheDate -Format
#Age(Birth; TheDate; Formate)
Let ( leapFactor = If ( Mod ( Year ( theDate ) ; 4 ) = 0 ; 1 ; 0 );
Case (
// Age in years
Format = 1 ; Year ( theDate ) - Year ( Birth ) - ( ( DayOfYear ( theDate ) - leapFactor ) < DayOfYear ( Birth ) );
// Age in years and days
Format = 2 ; Year ( theDate ) - Year ( Birth ) - ( ( DayOfYear ( theDate ) - leapFactor ) < DayOfYear ( Birth ) ) & " yıl" & Case (
( DayOfYear ( theDate ) - leapFactor ) ≥ DayOfYear ( Birth ) ; DayOfYear ( theDate ) - leapFactor - DayOfYear ( Birth ) ;
DayOfYear ( theDate ) + ( DayOfYear ( Date ( 12 ; 31 ; Year ( theDate ) ) - DayOfYear ( Birth ) - leapFactor ) ) ) & " gün" ;
// Age in years, months and days
Format = 3 ; Year ( theDate ) - Year ( Birth ) - ( ( DayOfYear ( theDate ) - leapFactor ) < DayOfYear ( Birth ) ) & " yıl" & Mod ( Month ( theDate ) - Month ( Birth ) + 12 - (Day ( theDate ) < Day ( Birth ) ) ; 12 ) & " ay" & (theDate - Date ( Month ( theDate ) - (Day ( theDate ) < Day ( Birth ) ) ; Day ( Birth ) ; Year ( theDate ) ) ) & " gün"
)
)