Skip to main content
← All functions

SUMIF

Adds the cells specified by a given criteria

G2Editable

Loading your interactive spreadsheet…

Preparing your worksheet…

Example notes

To sum everything on or before October 15 when dates include times, use "<"&DATE(2026,10,16): an exclusive next-day boundary includes midnight, noon and 23:59:59 on October 15 and excludes October 16 midnight. The result is 12 + 25 - 5 = 32. By contrast, "<="&DATE(2026,10,15) includes only the midnight row here and returns 12. A time is a fraction of a day added to a numeric date serial. Column A contains text labels; the formula compares numeric values in B. This is a single upper bound, not a date window; add a lower bound with SUMIFS if required.

=SUMIF(B2:B5,"<"&DATE(2026,10,16),C2:C5)
Inspect formula

Inspect the current formula

Read its written arguments or observe actual operation values in a separate local calculation. This action neither applies a draft nor grades an answer.

Read the formula, one argument at a time

Explore the written function calls and their inputs. The calculation result belongs to the complete formula.

SUMIF · top-level call

=SUMIF(B2:B5,"<"&DATE(2026,10,16),C2:C5)

1 / 3 · range

The range of cells that you want evaluated by criteria.

SUMIF reference ↗

Follow the cells behind a result

Read explicit local references and helper formulas using a separate calculation. Your draft stays in this field; the worksheet and practice checks do not change.

Downloads & compatibility

The worksheet runs locally. Published checks apply to the supplied example only. Native Excel and Google Sheets compatibility remain unverified.

SUMIF dates less than or equal to a cutoff

Use one condition to total matching amounts. Compare a region filter, an inclusive date-only cutoff and an exclusive next-day boundary for timestamps. Each example includes the complete source, formula and expected result.

Total amounts from one region

Total amounts from one region. The result is checked against a separately authored expected value for the supplied table. You can edit the data to explore the rule.

=SUMIF(C2:C6,"East",A2:A6)
Source data: Playground
AmountLabelRegionDate serialStatus
12HarborEast46296Paid
25CedarWest46301Pending
-5HarborEast46310Paid
18LumenEast46326Paid
0West46327Paid
Expected G2
25
Open this example in the worksheet
Sum dates less than or equal to a cutoff

For dates without times, "<="&DATE(2026,10,15) includes October 15. Join the quoted comparison operator to DATE with &: the condition tests numeric dates in B2:B5 and sums the matching amounts in C2:C5. The first three rows contribute 12 + 25 - 5 = 32. Column A contains readable text labels only; column B contains the actual date serials used for calculation. Convert imported text dates before comparing them. Dates use the 1900 date system; existing 1904-system workbooks need their own matching dates.

=SUMIF(B2:B5,"<="&DATE(2026,10,15),C2:C5)
Source data: Example2
Date label (text)Date serialAmount
2026-10-144630912
2026-10-154631025
2026-10-1546310-5
2026-10-164631118
Expected G2
32
Open this example in the worksheet
Include the whole cutoff day when dates contain times

To sum everything on or before October 15 when dates include times, use "<"&DATE(2026,10,16): an exclusive next-day boundary includes midnight, noon and 23:59:59 on October 15 and excludes October 16 midnight. The result is 12 + 25 - 5 = 32. By contrast, "<="&DATE(2026,10,15) includes only the midnight row here and returns 12. A time is a fraction of a day added to a numeric date serial. Column A contains text labels; the formula compares numeric values in B. This is a single upper bound, not a date window; add a lower bound with SUMIFS if required.

=SUMIF(B2:B5,"<"&DATE(2026,10,16),C2:C5)
Source data: Example3
Timestamp label (text)Date/time serialAmount
2026-10-15 00:00:004631012
2026-10-15 12:00:0046310.525
2026-10-15 23:59:5946310.99998842592-5
2026-10-16 00:00:004631118
Expected G2
32
Open this example in the worksheet

The supplied examples are checked in the browser engine. Native Excel and Google Sheets recalculation remain unverified.

Reference and compatibility

Sum the values in a range that meet criteria that you specify.

Univer 1.0.4 / Apache-2.0. Calculation checks cover the supplied examples only. The browser worksheet does not implement every Excel feature, external service or connected data type.

Univer 1.0.4 / Apache-2.0