Function Problems

Use a Drop-Down to Switch Excel SUMIFS Between Yearly and Weekly Totals

Rana GarciaRana Garcia Nov 20, 2026 869 views

Question details

Create a drop-down that switches a SUMIFS calculation between yearly and weekly reporting.

Use a Drop-Down to Switch Excel SUMIFS Between Yearly and Weekly Totals
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet contains year, month, period, and week fields, and the user wants to choose a reporting level from a drop-down list.
Observed behavior
The existing SUMIFS formula applies all criteria together, returning only the most detailed matching total.
Before you start

Identify the columns containing the year, week number, and values to sum. Check that the year and week inputs use the same data types and week-numbering convention as the source data.

Solution 1Recommended

Use a Drop-Down to Select the SUMIFS Criteria

Use this approach when you want one result cell to show either a yearly total or a weekly total.

This example uses column A for years, column B for week numbers, and column C for amounts. Cell E2 holds the report type, F2 the selected year, and G2 the selected week. Adjust the ranges and cell references to match your worksheet.

1
Create the report selector

Select E2, choose Data > Data Validation, and set Allow to List. Enter Yearly,Weekly in the Source box and click OK.

2
Enter the reporting inputs

Enter the year to report in F2 and, for a weekly report, enter the week number in G2.

3
Enter the formula

In the result cell, enter =IF(E2="Yearly",SUMIFS(C2:C10001,A2:A10001,F2),IF(E2="Weekly",SUMIFS(C2:C10001,A2:A10001,F2,B2:B10001,G2),"Select a report type"))

4
Test both views

Choose Yearly or Weekly from the E2 drop-down and compare the result with the matching source rows. Extend all three formula ranges to include your full dataset.

Use a Drop-Down to Select the SUMIFS Criteria
Month and period criteria: The example deliberately omits month and period criteria. If either must also restrict a report, add its criteria range and matching input to the relevant SUMIFS formula.
WPS Spreadsheet

Build a Yearly or Weekly SUMIFS Selector in WPS Spreadsheet

Use a list-based drop-down and an IF formula in WPS Spreadsheet to choose which SUMIFS criteria apply to your report.

  1. 1. Open the workbook: Open WPS Spreadsheet and use Open to select your Excel workbook.
  2. 2. Create the drop-down: Select E2, open Data > Data Validation, choose a list, and enter Yearly,Weekly as the source.
  3. 3. Enter the report inputs: Enter the year in F2 and the week number in G2. In this example, source years are in column A, weeks in column B, and amounts in column C.
  4. 4. Add the calculation: In a result cell, enter =IF(E2="Yearly",SUMIFS(C2:C10001,A2:A10001,F2),IF(E2="Weekly",SUMIFS(C2:C10001,A2:A10001,F2,B2:B10001,G2),"Select a report type")). Adjust the ranges to include your data, then test both choices in E2.
Switch between yearly and weekly totals in one result cellOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and data validation controls
microsoft office alternative - wps office

Frequently Asked Questions

Why does my SUMIFS formula return only a detailed total?

SUMIFS combines its criteria with AND logic, so a row must match every year, month, period, and week condition. Use an IF formula to select a SUMIFS calculation with only the criteria needed for the chosen report.

Can I calculate a weekly total without selecting a year?

You can use SUMIFS with only the week criterion, but it will combine matching week numbers from every year in the range. Include a year criterion when you need a week from a specific year.

How do I add a monthly option to the drop-down?

Add Monthly to the Data Validation list, provide a month input, and add an IF branch with SUMIFS criteria for both the selected year and month. Use a month criteria range that matches the size of the sum range.

What should I use for a large dataset?

A PivotTable can make it easier to filter by year and display weekly totals. Select the source data and choose Insert > PivotTable, then place the year, week, and amount fields in the appropriate areas.