Skip to content
WPForms Views
  • Features
  • ProductsExpand
    • Views for WPForms
    • Charts for WPForms
    • WPForms Import Entries
  • Pricing
  • Demo
  • Blog
  • SupportExpand
    • Docs
    • Contact Us
Login
Account
Get Views
WPForms Views

Getting Started

10
  • How to Install WPForms Views Plugin
  • How to upgrade your WPForms Views License
  • How to Add Views for WPForms License Key
  • How to Create Table View of WPForms Entries
  • How to Create a DataTable view of WPForms Entries in Frontend
  • How to Create List View of WPForms Entries
  • How to Design & Style Your WPForms View
  • How to hide empty fields in WPForms Views
  • How to use WPForms Smart Tags in Custom HTML field
  • How to Clone or Duplicate Form Entries in WPForms Views

Edit Entries

4
  • How to edit WPForms Entries from Frontend
  • How to Hide Form fields when editing entries
  • How to Unapprove Entry after Editing
  • How to send Email Notification after Editing Entry

Filter & Sort

7
  • How to Configure the Search Form
  • How to Filter WPForms Entries by Field Value
  • Sort WPForms Entries by Field Value
  • How to use Merge Tags to Filter WPForms Entries
  • How to Display only WPForms Starred Entries in Frontend
  • How to Display Only User Submitted Entries in WPForms
  • How to Display only Viewed WPForms Entries

Single Entry

1
  • How to Display WPForms Entry details on Single Page

Calculations

2
  • How to display WPForms Field Calculations in table footer
  • How to Display Field Calculations in Your View

Inline Edit

2
  • How to setup Inline Edit for WPForms Views
  • How to send Email Notification after Editing Entry using Inline Edit Add-on

Approve Entries

1
  • How to Show Only Approved WPForms Entries

Delete Entries

1
  • How to allow users to delete WPForms Entries from frontend

Google Maps

1
  • How to use Google Maps addon to display maps in view

Hooks & Filters

1
  • Code Examples

Import Entries

1
  • How to Import Entries into WPForms

Charts for WPForms

1
  • Getting Started With Charts for WPForms
View Categories
  • Home
  • Docs
  • Calculations
  • How to Display Field Calculations in Your View

How to Display Field Calculations in Your View

Aman
Updated on February 16, 2026

4 min read

The Calculations addon allows you to display Sum or Average calculations for numeric fields in your WPForms Views. You can place these calculations before or after your entry list to provide meaningful insights from your form data.

What You Can Do With Calculations #

  • Calculate Sum or Average of numeric field values
  • Choose between Visible Entries (respects filters/pagination) or All Entries
  • Place calculations anywhere in your view (before loop, after loop, or in the loop)
  • Customize the display text with merge tags
  • Support for text, number, and hidden field types

Adding a Calculation Field to Your View #

Step 1: Access the View Editor #

  1. Navigate to WPForms → Views
  2. Open the view where you want to add calculations
  3. You’ll see three sections: Before Entry List Fields, Entry List Fields, and After Entry List Fields

Step 2: Add the Calculation Field #

For calculations before the entry list:

  1. Click the “+ Add Field” button in the Before Entry List Fields section
  2. Scroll down and select “Calculation” from the field list
  3. The calculation field will be added to your view
WPForms Views Calculations Widget

For calculations after the entry list:

  1. Click the “+ Add Field” button in the After Entry List Fields section
  2. Select “Calculation” from the field list

Step 3: Configure the Calculation Field Settings #

When you click on the calculation field, the Field Settings panel opens on the right. Configure the following options:

Views for WPForms Calculations Settings in the Edit View page.
1. Select Field for Calculation #
  • Choose which form field’s values you want to calculate
  • Only text, number, and hidden field types are available
  • Example: If you have a “Price” or “Quantity” field, select it here
2. Calculation Data Source #

Choose which entries to include in your calculation:

Visible Entries (default): Calculates only the entries currently displayed

  • Respects search filters
  • Respects pagination (only current page)
  • Respects view filters
  • Perfect for “Total on this page” scenarios

All Entries: Calculates across all entries in the view

  • Ignores pagination
  • Still respects view filters and permissions
  • Perfect for “Grand Total” scenarios
3. Calculation Type #

Select the type of calculation:

Sum: Adds up all the values

  • Example: Total sales, Total donations, Total quantity

Average: Calculates the mean value

  • Example: Average rating, Average price, Average score
4. Label (Optional) #

Customize how the result is displayed:

  • Default: {result} (displays just the number)
  • Use {result} as a placeholder for the calculated value
  • Examples:
    • Total: ${result}
    • Average Score: {result} out of 10
    • Total Donations: ${result}
    • {result} entries processed

Real-World Examples #

Example 1: Total Sales Before Entry List #

Scenario: Display total sales amount at the top of your order list

Setup:

  • Field: Select your “Order Amount” field
  • Data Source: All Entries
  • Calculation Type: Sum
  • Label: Total Sales: ${result}
  • Location: Before Loop section

Result: Shows “Total Sales: $15,234.50” above your order entries


Example 2: Average Rating After Product Reviews #

Scenario: Show average product rating below review entries

Setup:

  • Field: Select your “Rating” field (1-5 scale)
  • Data Source: All Entries
  • Calculation Type: Average
  • Label: Average Rating: {result} ⭐
  • Location: After Loop section

Result: Shows “Average Rating: 4.23 ⭐” below all reviews


Example 3: Page Total in Paginated View #

Scenario: Show subtotal for current page in a paginated order list

Setup:

  • Field: Select your “Amount” field
  • Data Source: Visible Entries
  • Calculation Type: Sum
  • Label: Page Total: ${result}
  • Location: After Loop section

Result: Shows the sum of only the entries on the current page


Example 4: Multiple Calculations #

You can add multiple calculation fields to show different metrics:

Before Loop:

  • Total Revenue: ${result} (Sum, All Entries, Amount field)
  • Total Orders: {result} (Sum, All Entries, Quantity field)

After Loop:

  • Page Subtotal: ${result} (Sum, Visible Entries, Amount field)

Best Practices #

When to Use “Visible Entries” #

  • Paginated views where you want per-page totals
  • Filtered results where the calculation should update with filters
  • Search results where you want to calculate only matching entries
  • Views with “Load More” or “Show More” features

When to Use “All Entries” #

  • Grand totals that should remain constant
  • Overall statistics (like average rating)
  • Summary dashboards
  • Views where users need to see the complete picture

Field Type Considerations #

  • Use number fields for precise calculations (prices, quantities, scores)
  • Use text fields if they contain numeric values
  • Hidden fields work great for calculated values or unique identifiers
  • Non-numeric values are treated as 0 in calculations

Styling Your Calculations #

You can style calculation fields using CSS:

/* Target calculation in before loop */
.wpforms-view .wpforms-view-field-type-calculation-value {
    font-size: 24px;
    font-weight: bold;
    color: #2271b1;
    padding: 15px;
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    margin-bottom: 20px;
}

/* Different style for after loop calculations */
.wpforms-view-section-afterloop .wpforms-view-field-type-calculation-value {
    text-align: right;
    font-size: 18px;
    padding: 10px;
    border-top: 2px solid #ddd;
}

Add this CSS to Appearance → Customize → Additional CSS or your theme’s stylesheet.

Combining with Other Features #

With Filters #

When you set up view filters, calculations using “All Entries” will respect those filters. This is perfect for:

  • Filtering by date range and showing totals for that period
  • Filtering by category and calculating category-specific metrics
  • Filtering by user and showing user-specific totals

With Search #

When users search your view, calculations set to “Visible Entries” will update to show results for only the matching entries.

With Conditional Display #

You can use Display Conditions on calculation fields to show/hide them based on criteria:

  • Show “Grand Total” only if more than 10 entries exist
  • Display “Average” only for completed entries
  • Conditional calculations based on entry dates or values

Troubleshooting #

Calculation Shows 0 #

  • Verify you’ve selected the correct field
  • Ensure the field contains numeric values
  • Check that entries exist in your view
  • Confirm the field type is text, number, or hidden

Calculation Not Updating #

  • Clear your browser cache
  • Verify “Calculation Data Source” setting matches your needs
  • Check if view filters are affecting available entries

Wrong Values in Calculation #

  • Ensure the field contains clean numeric data (no currency symbols or text)
  • Check for empty values that might affect averages
  • Verify view filters aren’t excluding important entries

Advanced: Filter Hook #

Developers can modify calculation results using the filter hook:

add_filter( 'wpf_views/calculations/result', 'custom_calculation_display', 10, 3 );

function custom_calculation_display( $text, $entries, $formFieldId ) {
    // Add thousand separators
    $result = str_replace( ' ', ',', $text );
    
    // Add currency symbol
    if ( $formFieldId == 5 ) { // Check specific field
        $result = '$' . number_format( floatval( $text ), 2 );
    }
    
    return $result;
}

Summary #

Calculations in WPForms Views provide powerful insights into your form data:

  • Choose Sum or Average calculations
  • Calculate from visible or all entries
  • Place before, after, or within entry loops
  • Customize display with merge tags
  • Works with filters, search, and pagination
  • Style with custom CSS

How to display WPForms Field Calculations in table footerHow to display WPForms Field Calculations in table footer
Table of Contents
  • What You Can Do With Calculations
  • Adding a Calculation Field to Your View
    • Step 1: Access the View Editor
    • Step 2: Add the Calculation Field
    • Step 3: Configure the Calculation Field Settings
      • 1. Select Field for Calculation
      • 2. Calculation Data Source
      • 3. Calculation Type
      • 4. Label (Optional)
  • Real-World Examples
    • Example 1: Total Sales Before Entry List
    • Example 2: Average Rating After Product Reviews
    • Example 3: Page Total in Paginated View
    • Example 4: Multiple Calculations
  • Best Practices
    • When to Use "Visible Entries"
    • When to Use "All Entries"
    • Field Type Considerations
    • Styling Your Calculations
  • Combining with Other Features
    • With Filters
    • With Search
    • With Conditional Display
  • Troubleshooting
    • Calculation Shows 0
    • Calculation Not Updating
    • Wrong Values in Calculation
  • Advanced: Filter Hook
  • Summary

Views for WPForms

Drag & Drop View builder for WPForms.

We build scalable, intelligent and professional web apps to simplify lives of different businesses and people since 2010.

Our Other WordPress Plugins

Views for Ninja Forms

Views for Contact Form 7

Sitemap

  • Home
  • Features
  • Pricing
  • Blog
  • Inline Entry Editing
  • WPForms Import Entries Add-on
  • Charts for WPForms
  • Documentation
  • Changelog

Company

  • My Account
  • FAQs
  • Terms & Conditions
  • Cancellation & Refund Policy
  • Privacy Policy
  • Sitemap
  • Contact Us

We Accept All Major Credit Cards For Fast And Easy Payment

© 2026 WPForms Views

Facebook X YouTube

Disclaimer: Views for WPForms is an independent third-party plugin developed by WEBHOLICS. It is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WPForms or its parent company. All product names, logos, and brands are property of their respective owners.

  • Features
  • Products
    • Views for WPForms
    • Charts for WPForms
    • WPForms Import Entries
  • Pricing
  • Demo
  • Blog
  • Support
    • Docs
    • Contact Us