Sum Values by Selected Month Across Columns in Excel
Question details
Calculate the total for a selected month when monthly values are arranged in columns on another worksheet.

- 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.
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.
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.
On the worksheet where you want the result, enter a month in cell B1 that matches a header on the Monthly Data sheet.
Select cell B3 and enter =SUMPRODUCT('Monthly Data'!$B$25:$M$31*('Monthly Data'!$B$24:$M$24=$B$1)).
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.
Press Enter, then change B1 to another matching month and confirm that B3 updates.

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. Open the workbook: Open WPS Spreadsheet and select Open to load your Excel workbook.
- 2. Enter a month: On the result sheet, enter a month in B1 that matches a header on the source sheet.
- 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. Calculate and verify: Press Enter and check that the total matches the values beneath the selected month.

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.




