Excel regarding dates calculation

Hello All,

I have an issue with excel dates calculation. I have a column name “PolicyToDate” so I need calculate the difference between today’s date and date mentioned i column and if the number is greater than or equal to 365 then I need to write 365 in excel column if the number is less than 365 then I need to write that value in the excel. How to do this? Please help me sorting the issue.

@ramshiva_reddy

This helps in getting date difference and then checking condition

If(DateDiff(DateInterval.Day,Cdate(currentRow("PolicyToDate").ToString),Now)>=365,365, DateDiff(DateInterval.Day,Cdate(currentRow("PolicyToDate").ToString),Now))

Cheers