We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Calculate age on specific data

I'm trying to recreate an Excel sheet with XlsIO which was initially created with Excel.
Most columns I can figure out but I'm struggling with calculating the age on a specific date.

I open an existing xlsx-file as a template and in this template the date is set in cell D1
Next, I loop through a dataset and write data of persons starting at row 7.
Column F holds the DOB of the person, in column G I need to calculate his age in years.
In Excel this formula is used:  =DATEDIF(Start_Date, End_Date, Unit), making =DATEDIF(F7, D$1$, "y") in my example.
What is the XlsIO equivalent?

Thanks

3 Replies

AV Abirami Varadharajan Syncfusion Team September 6, 2017 01:10 PM UTC

Hi Paul, 
 
Thank you for contacting Syncfusion support. 
 
Currently, we don’t have support to calculate DATEDIF function. We don’t have immediate plans to implement this feature as Excel also calculates incorrect results under certain scenario. Please refer the following link. 
 
 
Please let us know if you have any concerns. 
 
Regards, 
Abirami 



PM Paul Meems September 7, 2017 08:28 AM UTC

Thanks for the response. I already anticipated and found another solution.

Leave the original formula in the template and just copy it to the new cells. Then it works fine.

I also need to change the formula to =GEH.GET.(($D$1-F7)/365) to get it to work.

Support provided a full working sample at 132506 



AV Abirami Varadharajan Syncfusion Team September 8, 2017 06:40 AM UTC

Hi Paul, 

Thank you for updating us. 

We are glad that your requirement is fulfilled. Please let us know if you need any further assistance. 

Regards, 
Abirami. 


Loader.
Live Chat Icon For mobile
Up arrow icon