Fix Notion Rollup Showing Wrong Sum: Type Coercion Diagnosis
🔍 WiseChecker

Fix Notion Rollup Showing Wrong Sum: Type Coercion Diagnosis

When a Notion rollup property displays an incorrect sum, the most common cause is type coercion. Notion automatically converts data types when rolling up values from related database properties, and this conversion can turn numbers into text or text into numbers. This article explains how type coercion works in Notion rollups, how to diagnose it, and how to fix the wrong sum.

Type coercion happens when Notion tries to combine values that are stored in different formats. For example, a property may contain the string “5” instead of the number 5. When you sum such values, Notion concatenates them as text instead of adding them numerically. You will learn to inspect the underlying data types and apply targeted fixes to each property.

By the end of this article, you will be able to identify type coercion in any rollup, correct the data types at the source, and ensure your sums are accurate. The fix involves checking the source property type, using formula properties to coerce types explicitly, and verifying the rollup configuration.

Key Takeaways: Fixing Notion Rollup Sum Errors

  • Rollup > Sum aggregation: Sums only numeric values; text values cause concatenation or zero results.
  • Formula property with toNumber(): Converts text that looks like a number into a true numeric value for accurate summing.
  • Source property type check: Number, Formula (number), or Rollup (number) are the only types that sum correctly without coercion.

ADVERTISEMENT

Why Notion Rollup Shows the Wrong Sum

Notion rollups aggregate values from a related database based on a source property. The rollup can perform operations like Sum, Average, Count, Max, and Min. For Sum to work correctly, every value in the source property must be a number. If any value is stored as text, Notion treats the entire aggregation as a text operation, which either concatenates the values or returns zero.

Type coercion is Notion’s automatic conversion of one data type to another when performing operations. In rollups, coercion occurs when the source property contains mixed types. For instance, a “Price” column may have some entries as Number type and others as Text type because of manual entry or import. When you roll up that column and choose Sum, Notion attempts to coerce all values to a common type. If any value is text, Notion may convert all values to text, resulting in concatenation like “51015” instead of 30.

Another cause is the use of a Rollup property as the source for another rollup. Nested rollups can compound type issues because the intermediate rollup may output a text representation of a number. Similarly, Formula properties that return text (using format() or concat()) produce text even if the formula calculates a number.

How Notion Handles Data Types in Rollups

Notion stores properties with explicit types: Text, Number, Select, Date, Formula, Rollup, and others. When you create a rollup, Notion reads the source property type. If the source is a Number property, the rollup works numerically. If the source is a Text property, the rollup treats all values as strings, even if they look like numbers. The rollup’s aggregation function then determines the output: Sum on text values produces concatenation, Average on text values returns 0, and Count always counts the number of entries regardless of type.

Steps to Diagnose and Fix a Wrong Sum in a Notion Rollup

Follow these steps in order. Each step isolates the cause and applies a fix. Do not skip any step.

  1. Check the source property type in the related database
    Open the related database that contains the values you are rolling up. Locate the property used as the source for the rollup. Hover over the property name and look at the type icon. A Number property shows a “#” icon. A Text property shows a “T” icon. If the icon shows “T”, the property is text and will not sum correctly. Change it to Number if all values are numeric. If the property is already Number but the sum is still wrong, proceed to step 2.
  2. Inspect individual values for hidden text
    Click into a cell in the source property. Look for leading or trailing spaces, currency symbols, or commas. Notion’s Number property does not store formatting characters, but imported data may include them. For example, a cell showing “$10” is stored as text because of the dollar sign. Remove all non-numeric characters from every cell. Use Find and Replace in the database to remove symbols: open the database menu, select Find and Replace, enter “$” in Find and leave Replace blank, then click Replace All. Repeat for commas and spaces.
  3. Create a formula property to convert text to number
    If the source property must remain as text for other purposes, add a Formula property to the related database. Name it “Numeric Value” or similar. Use the formula toNumber(prop("Source Property Name")). This converts the text to a number. If the text cannot be parsed as a number, the formula returns an empty value. Verify that the formula column shows numbers, not empty cells. Then update your rollup to use this new Formula property as the source instead of the original text property.
  4. Verify the rollup configuration
    Go to the database where the rollup property resides. Click on the rollup property name and select Edit property. Confirm that the Related database is correct and that the Property selected is the one you just fixed. Ensure the Aggregation is set to Sum. If you changed the source property, you may need to re-select it from the dropdown. Click Save. The rollup should now display the correct sum.
  5. Test with a simple rollup of two known values
    To confirm the fix works, add two rows in the related database with easy numbers like 10 and 20. Ensure they are stored as Number or converted via formula. The rollup should show 30. If it shows “1020” or 0, the source property still contains text. Repeat steps 2 and 3.

ADVERTISEMENT

If Notion Still Shows the Wrong Sum After the Main Fix

Rollup Sources Another Rollup

If your rollup uses a Rollup property as its source, the intermediate rollup may output text. Open the intermediate rollup property and check its aggregation. Even if the intermediate rollup is set to Sum, its output is a number. But if it is set to Show Original or Show Unique, the output may be text. Change the intermediate rollup to use a numeric aggregation like Sum or Average. Alternatively, create a Formula property that extracts the numeric value from the intermediate rollup using toNumber(format(prop("Intermediate Rollup"))) and use that formula as the source for the final rollup.

Formula Property Returns Text

A Formula property that uses format() or string concatenation returns text even if the result looks numeric. For example, format(prop("Price") + prop("Tax")) produces a text string. To fix this, remove the format() call and let the formula return a number. If you need to display the number with formatting, use a separate Formula property for display and keep the raw number property for the rollup.

Empty or Missing Values Cause Sum to Be Zero

If some rows in the related database have no value in the source property, the rollup sum may be lower than expected. Notion treats empty cells as 0 for Number properties and as empty strings for text properties. To include only rows with values, consider using a filter on the related database to exclude empty rows. Or use a Formula property that returns 0 if the cell is empty: if(empty(prop("Source")), 0, prop("Source")). This ensures every row contributes a number to the sum.

Item Correct Type for Sum Incorrect Type That Causes Errors
Source property type Number, Formula (number), Rollup (Sum/Average) Text, Select, Date, Formula (text), Rollup (Show Original)
Example value 100 (no formatting) “100” (quotes indicate text), “$100”, “100.00” in a Text property
Rollup aggregation Sum, Average, Min, Max Count, Show Original, Show Unique
Fix method Use toNumber() formula or change property type to Number Remove non-numeric characters or change property type

After applying the fixes above, your Notion rollup should display the correct sum. Type coercion is a silent issue that often goes unnoticed until you compare manual totals. Regularly check the source property types in any database that feeds into a rollup. Use a Formula property with toNumber() as a safety net when you cannot control the original data entry. This approach keeps your rollups accurate and your reports reliable.

ADVERTISEMENT