7 Replies Latest reply on Aug 3, 2017 7:07 AM by Zhouyi Zhang

# DateDiff showing incorrect results

Dear all,

I am trying to create a gantt chart and have done all the possible things, I am trying to create my profile and the work experience over the years, however the difference between the date using datediff function is throwing some unusual results, please help

• ###### 1. Re: DateDiff showing incorrect results

Hi, Ameet

What's your calculation for datediff looks like? or it will be more helpful if you could share a workbook?

ZZ

• ###### 2. Re: DateDiff showing incorrect results

Hi Ameet,

datediff('year',start,finish)

Regards

• ###### 3. Re: DateDiff showing incorrect results

Alan/ Zhouyi,

I did that and tried it again by clearing the work book, and voila it worked, thanks a lot, However I received few more errors, I have an excel sheet with all the relevant information for my profile, however when I import the other sheets the timeline changes, I am not sure why does this happen

Below is the screen shot, no sooner I add other sheet from the data source the timeline gets distorted, I am unable to understand the reason behind the same, Would appreciate you feedback from the community

Zhouyi,

I am not sure how I can share the workbook

• ###### 4. Re: DateDiff showing incorrect results

Hi Ammet,
To calculate the number of years use : INT((DATEDIFF('day',[Start],[Finish]))/365)

To Calculate the number of months after years use : INT((datediff('month',[Start],[Finish]))%12)

To Calculate the remaining days use : (DATEDIFF('day',[Start],[Finish])%365)%30

You can then concatenate the three values to get the result in YY:MM:DD format .

Do let me know if it helps.

Thanks
Rahul Singh

1 of 1 people found this helpful
• ###### 5. Re: DateDiff showing incorrect results

Hi, Ameet

Save the workbook as .twbx with sample data, not your real data, but with your issue, and then attach to your original post, not the inbox. Or reply by using the advanced editor in your replies right top corner.

ZZ

• ###### 6. Re: DateDiff showing incorrect results

Dear Zhouyi,,

Please see attached the workbook and also the excel workbook where in I want to bring in all the information on dashbaord without distorting the timeline

• ###### 7. Re: DateDiff showing incorrect results

Hi, Ameet