---
title: "SumValues() formula query function"
slug: "sumvalues-formula-query-function"
updated: 2026-06-01T16:37:50Z
published: 2026-06-01T16:37:50Z
canonical: "help.quickbase.com/sumvalues-formula-query-function"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://help.quickbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SumValues() formula query function

SumValues() is a [formula query function](/v1/docs/what-are-formula-queries) you can use to calculate the sum of values in a field for records that match the query.

## SumValues() examples

|  | To query the same table | To query a different table | Result |
| --- | --- | --- | --- |
| Function layout | `SumValues(GetRecords("{query}"), Field ID)` | `SumValues(GetRecords("{query}", Table Alias), Field ID))` | Numeric value |
| Example using hard-coded value | `SumValues(GetRecords("{6.EX.'In Progress'}"), 4)`​ Calculates the sum of the values in field id 4 where field ID 6 is equal to "In Progress"​ | `SumValues(GetRecords("{6.EX.'In Progress'}", [_DBID_PROJECTS]), 4)`​ Calculates the sum of the values in field ID 4 where field ID 6 is equal to "In Progress"​ In this case, field 4, field 6 and the records are all from the table with table alias `DBID_PROJECTS`. | ![Example field titled: Total hours spent on all In-Progress projects. Example value returned: 5](https://cdn.document360.io/dd260e4e-10bb-4b66-8fb3-5504c272b904/Images/Documentation/17494926318228.png) Sum value: 5 |
| Example using field reference | `SumValues(GetRecords("{6.EX.'"&amp;[Manager name]&amp;"'}", ), 4)`​ Calculates the sum of the values in field ID 4 where field id 6 is equal to the value that populates the `Manager name` field in the record this formula is being calculated on | `SumValues(GetRecords("{6.EX.'"&amp;[Manager name]&amp;"'}", [_DBID_PROJECTS]), 4)`​ Calculates the sum of the values in field ID 4 where field id 6 is equal to the value that populates the `Manager name` field in the record this formula is being calculated on In this case, field 4, field 6 and the records are all from the table with alias `DBID_PROJECTS` | ![Example field titled: Total manager hours spent. Example value returned: 7](https://cdn.document360.io/dd260e4e-10bb-4b66-8fb3-5504c272b904/Images/Documentation/17494940490772.png) Sum value: 7 |
