How to sum column B where column A is between Jan 1 and Dec 31, 2024

公式

=SUMIFS(B:B, A:A, ">="&DATE(2024,1,1), A:A, "<="&DATE(2024,12,31))

说明

SUMIFS adds numbers in B only when the matching date in A sits inside the range. DATE() builds real date values so the comparison does not depend on locale text like 1/1/2024.

步骤

  1. Put dates in column A and amounts in column B.
  2. SUMIFS scans B:B as the sum range.
  3. The first criterion keeps rows on or after 1 Jan 2024.
  4. The second criterion keeps rows on or before 31 Dec 2024.

变体

Named start and end cells

Store the start date in E1 and the end date in F1 so you can change the window without editing the formula.

=SUMIFS(B:B, A:A, ">="&$E$1, A:A, "<="&$F$1)

Current month only

EOMONTH walks to month boundaries so the range always tracks today.

=SUMIFS(B:B, A:A, ">="&EOMONTH(TODAY(),-1)+1, A:A, "<="&EOMONTH(TODAY(),0))

Exclude blanks

Adds a third test so empty amount cells are ignored.

=SUMIFS(B:B, A:A, ">="&DATE(2024,1,1), A:A, "<="&DATE(2024,12,31), B:B, "<>")