Prorated refund calculator

When I worked on and with the front-lines of support teams, a pretty frequent need was a proration calculator. There was always at least one person who never felt comfortable calculating a prorated amount themselves, too.

This calculator automatically determines a prorated refund for things like subscriptions on set dates.


How to use this calculator

  1. Enter the full amount of the original charge. If the customer paid $1000 for service, enter $1000.

  2. Enter the start date of the term being refunded. If the customer was charged $1000 for service on January 1st, 2023, select January 1st, 2023.

  3. Enter the date the refund is effective. This will determine the start of the proration period.

  4. Enter the original end-date of the subscription. If the customer was charged $1000 for service on January 1st, 2023 and is on an annual subscription, this would be December 31st, 2023.

{note: trim=yes}1) Enter full amount to prorate: ${formtext: name=fullamount}

  1. Enter the service start date: {formdate: YYYY-MM-DD; name=startdate}

  2. Select start date of the partial refund: {formdate: YYYY-MM-DD; name=prorationdate}

  3. Select end date for the partial refund: {formdate: YYYY-MM-DD; default={time: YYYY-MM-DD; shift=+1M}; name=enddate}{fullterm=datetimediff(startdate, enddate, "D")}{prorationperiod=datetimediff(prorationdate, enddate, "D")}{endnote}{if: datetimediff(startdate, prorationdate, "D")<0}{error: Partial refund date must be after the service start date; block=yes}{elseif: datetimediff(prorationdate, enddate, "D")<0}{error: End date of partial refund must be after the partial refund date; block=yes}{else}{note: trim=left}
    The prorated refund amount is {endnote}{=(fullamount/fullterm)*prorationperiod; format=$.2f}{endif}


Things to know

  • the only text that will actually be output is the refund dollar amount. All other text is hidden in a note.
  • the format of the final refund amount is currently in USD, but can be customized to your locale by editing the format setting of that field
  • proration amount is determined by how many days remain in the plan, and includes the end-date as a day
  • ensure all of your dates are accurately entered for this calculator to be accurate

just for fun, here's a second version of the same thing but it has a checkbox for annual subscriptions so you don't have to use a 3rd date picker if it's an annual plan. Unchecking the box still lets you manually select a date:

{note: trim=yes}1) Enter full amount to prorate: ${formtext: name=fullamount}

2) Enter the service start date: {formdate: YYYY-MM-DD; name=startdate}

3) Select start date of the partial refund: {formdate: YYYY-MM-DD; name=prorationdate}

4) Select end date for the partial refund: {formtoggle: name=annual subscription (adds 1 year to start date); default=yes}{endnote}{if: `annual subscription (adds 1 year to start date)`}{enddate={time: YYYY-MM-DD; at={=datetimeadd(datetimeadd(startdate, 1, "Y"), -1, "D")}}}{else}
Enter subscription end-date: {formdate: YYYY-MM-DD; default={time: YYYY-MM-DD; shift=+1M}; name=enddate}{endif}{fullterm=datetimediff(startdate, enddate, "D")}{prorationperiod=datetimediff(prorationdate, enddate, "D")}{if: datetimediff(startdate, prorationdate, "D")<0}{error: Partial refund date must be after the service start date; block=yes}{elseif: datetimediff(prorationdate, enddate, "D")<0}{error: End date of partial refund must be after the partial refund date; block=yes}{else}{note: trim=left}
The prorated refund amount is {endnote}{=(fullamount/fullterm)*prorationperiod; format=$.2f}{endif}

1 Like