Function Problems

Sum Values by Selected Month Across Columns in Excel

Ayan MasoodAyan Masood Dec 2, 2026 868 views

Question details

Calculate the total for a selected month when monthly values are arranged in columns on another worksheet.

Sum Values by Selected Month Across Columns in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A selected month is entered on one worksheet, and month headers and values are stored in a table on another worksheet.
Observed behavior
The desired result is a single total of all values in the column or columns matching the selected month.
Before you start

Identify the selected-month cell, the month-header row, and the values range. Ensure the headers and selected month contain matching text or the same underlying date values; matching date displays alone are not enough.

Solution 1Recommended

Use SUMPRODUCT to total the selected month

Use this formula when month headers run across columns and the values to total are on another worksheet.

The example uses B1 for the selected month on the current worksheet. The source sheet, named Monthly Data, has headers in B24:M24 and values in B25:M31. The formula totals every column whose header matches B1.

1
Enter the selected month

On the worksheet where you want the result, enter a month in cell B1 that matches a header on the Monthly Data sheet.

2
Enter the formula

Select cell B3 and enter =SUMPRODUCT('Monthly Data'!$B$25:$M$31*('Monthly Data'!$B$24:$M$24=$B$1)).

3
Adjust the references

Replace Monthly Data with the actual source sheet name, and change the header and values ranges if your table is in different cells. Keep the two ranges aligned to the same columns.

4
Check the total

Press Enter, then change B1 to another matching month and confirm that B3 updates.

Use SUMPRODUCT to total the selected month
Check header and value types: Dates must match as underlying values, not just in appearance. Text in the values range can cause an error; use numeric values or blank cells instead.
Calculate monthly totals

Sum a selected month in WPS Spreadsheet

Use SUMPRODUCT in WPS Spreadsheet to match a month header on another sheet and total the values beneath it.

  1. 1. Open the workbook: Open WPS Spreadsheet and select Open to load your Excel workbook.
  2. 2. Enter a month: On the result sheet, enter a month in B1 that matches a header on the source sheet.
  3. 3. Enter the formula: Select B3 and enter =SUMPRODUCT('Monthly Data'!$B$25:$M$31*('Monthly Data'!$B$24:$M$24=$B$1)). Replace the sheet name and ranges with those in your workbook.
  4. 4. Calculate and verify: Press Enter and check that the total matches the values beneath the selected month.
Total values across all columns matching the selected monthOpen and edit Microsoft Excel XLSX and XLS filesUpdate the total by changing the month selectionWork with a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does the formula return zero for a month that appears in the headers?

Check B1 and the source headers for extra spaces or different value types. If they are dates, they must have the same underlying date value, even if both display the same month.

How do I refer to a source sheet with spaces in its name?

Enclose the sheet name in single quotes before the exclamation mark, as in 'Monthly Data'!$B$24:$M$24.

What happens if the same month appears in more than one column?

SUMPRODUCT totals the values in every column whose header matches the selected month. Include a year in the headers and selection if each month must be distinguished by year.

Why does SUMPRODUCT return a value error?

Check that the header and values ranges cover the same columns, and look for text or error values in the values range. Replace unintended text with numbers or blank cells.