Hi Dinakar,
If you can define these two dates as characteristic, you can create replacement path variables for these dates and create another formula variable with customer exit, you can read the values of the date variables, derive start and end date and use a standart function to calculate the number of variables in the exit.
I hope it gives an idea and if you can add them as characteristic pleae remind that you have to add the date characteristics to the rows for the variables to get their values.
Regards
Yasemin...