Logo
Home
Resources

Product

Custom Workflow

Resources

Blog
Youtube
Template
Home
>
Product
>
Template Top
>
detail

HubSpot Custom Workflow Guide: Pro-rata Calculation Based on Start and End Dates

We will explain the "Pro-rata Calculation Custom Workflow Action," designed to automate complex amount calculations based on contract or subscription periods—a task often difficult to achieve with HubSpot’s standard features alone.

Demo Video

Over view
Code

Detail

Objective

The purpose of this action is to accurately distribute revenue or expenses that fluctuate based on a specific timeframe (Start Date to End Date) across months or days. By eliminating manual calculation errors, it enables real-time calculation and updates of the figures necessary for revenue recognition and budget management directly within HubSpot.

Use Cases

  • Subscription Revenue Management: Prorating annual contract revenue into monthly segments to generate monthly revenue reports.
  • First/Last Month Proration: Calculating the exact billing amount based on the number of days if a contract starts or ends in the middle of a month.
  • Campaign & Ad Spend Allocation: Distributing the total budget of a multi-month marketing initiative across each month based on the active period.

Implementation Steps

1. Add and Connect the Action in Workflow

Click the "+" icon in the HubSpot workflow editor and select "Pro-rata Calculation" from the list of custom actions.

2. Select the Calculation Logic

Choose the calculation base from the dropdown menu according to your business requirements:

  • Monthly Proration (MONTHLY): Divides by the actual "number of months." If starting mid-month, the first month is treated as "0.x months" to calculate the monthly equivalent.
  • Daily Proration (DAILY): Divides equally by the "total number of days" in the period. It calculates a daily rate and allocates it based on the elapsed days in each month.

3. Specify Input Values (Amount and Period)

Map the source data from your HubSpot properties:

  • Target Amount: The total contract value or budget (e.g., Deal "Amount").
  • Start & End Date: Specify the date properties, such as the contract term.

4. Configure Rounding Details

Specify the precision of the calculation in the "Decimal Places" field:

  • Set to 0: Rounds to the nearest whole number (common for JPY management).
  • Set to 1–4: Use this for foreign currency management or when more detailed ratio calculations are required.

5. Output and Mapping of Calculation Results

Once the action completes, the following items are generated dynamically. Save these to your pre-created custom properties using the "Set property value" action:

  • First Month Amount: The amount allocated to the first month.
  • Mid-term Amount: The total amount for a "full month" excluding the start and end months.
  • Final Month Amount: The amount allocated to the last month (the final value including any rounding adjustments).
  • Number of Mid-term Periods: The number of full months between the start and end.
  • Total Days: The total number of days from start to finish.

‍

Source Code

HTML
CSS
Javascript

FAQ

How should I choose between "Monthly Proration" and "Daily Proration"?

If you want to recognize revenue based on monthly contracts, such as monthly subscriptions, "Monthly Proration" is suitable. On the other hand, "Daily Proration" is best when you want to distribute costs equally based on the exact number of days elapsed, such as for ad placement periods or rental fees.

How are the first and last months calculated if a contract starts or ends mid-month?

The action automatically determines the number of days in that specific month and performs a pro-rata calculation. For example, if a contract starts on the 15th of a 31-day month, it calculates the ratio for the remaining 17 days (15th–31st) to determine the exact amount. No manual adjustment is needed.

Where are the calculation results saved in HubSpot?

Results are automatically output to the custom properties you specify during setup (e.g., "First Month Amount," "Mid-term Amount," etc.). This allows you to use these calculated figures as axes for reporting or as triggers for secondary workflows.

Search

Search more

Related Template

Need Customization?

We can customize this sample to match your specific business requirements.

Book Free Consultation

Got a quick dev request?

Put it on Trello!Need a fix for HubSpot, CMS, or GAS? Post it on Trello.

Development Requests Here

HubSpot Custom Workflow Guide: Pro-rata Calculation Based on Start and End Dates

GAS Library Guide: Identifying Web Services via DNS Record Analysis

HubSpot Custom Workflow Guide: Automating Text Generation with Generative AI

GAS Library Guide: Automatically Extracting and Managing Overdue HubSpot Tasks in Google Sheets

How to Configure Date Add/Subtract Actions in HubSpot Custom Workflows

Company Info
Name : SweetsVillage .Inc
CEO :
‍
Tomoo Motoyama

HomeTemplateCustomWorkflow
Terms & ConditionsPrivacy PolicyContact us

Copyright ©SweetsVillage .Inc

Back To Top Image