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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Calculate age on specific data

Thread ID:





132499 Sep 5,2017 12:40 PM UTC Sep 8,2017 06:40 AM UTC ASP.NET MVC (Classic) 3
Tags: XlsIO
Paul Meems
Asked On September 5, 2017 12:40 PM UTC

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?


Abirami Varadharajan [Syncfusion]
Replied On 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. 

Paul Meems
Replied On 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 

Abirami Varadharajan [Syncfusion]
Replied On 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. 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon