logo
search
Formula Errors

How to Calculate and Compare Weekly Peak Values in Excel

John WilsonJohn Wilson Oct 19, 2026 868 views

Question details

The user needs a formula to calculate the difference between daily recorded amounts and the highest amount recorded for the matching week.

How to Calculate and Compare Weekly Peak Values in Excel
Product
Excel
Device & OS
not provided
Scenario
Tracking daily entries categorized by weeks and analyzing how each day's entry compares to that specific week's maximum value.
Observed behavior
The user needs to implement a dynamic formula that correctly identifies the weekly peak and calculates the variance while accommodating newly added rows.
Before you start

Ensure your dataset is properly organized with dedicated columns for the 'Week' identifier and the daily 'Amount'. It is highly recommended to convert your data range into an Excel Table (Ctrl+T) first, so your formula ranges automatically expand when new daily rows are added.

Solution 1Recommended

Use the MAXIFS Function to Calculate Peak Variance

The MAXIFS function is the most efficient way to find a conditional maximum value and compare it directly within the same row.

The MAXIFS function allows you to find the highest value in a specified range that meets certain criteria—in this case, matching the week number or label. By subtracting this peak value from the current row's amount, you obtain the exact variance.

1
Select the target cell

Click on the first empty cell in your 'Weekly Peak Variance' column (for example, cell E2).

2
Enter the MAXIFS formula

Type the formula =$D2-MAXIFS($D$2:$D$1000,$A$2:$A$1000,$A2) into the formula bar. Assume Column D contains the Amounts and Column A contains the Week identifiers.

3
Apply the formula to the column

Press Enter to execute the calculation. Then, click and drag the fill handle (the small square at the bottom-right corner of the cell) down to apply the formula to all rows in your dataset.

Use the MAXIFS Function to Calculate Peak Variance
Understanding the formula result: The peak value for each week will return exactly 0. Any amount lower than the weekly peak will return a negative number, indicating exactly how far below the peak that day's entry is.
Seamless Data Analysis

Calculate Weekly Peak Values Easily in WPS Spreadsheet

WPS Spreadsheet fully supports advanced mathematical and conditional functions like MAXIFS, allowing you to track and analyze daily or weekly variances effortlessly. It is a lightweight alternative that perfectly handles complex data calculations.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the workbook containing your daily amounts and week labels.
  2. 2. Input the MAXIFS formula: Select the target variance cell and input the formula =$D2-MAXIFS($D$2:$D$1000,$A$2:$A$1000,$A2).
  3. 3. Calculate the variance: Press Enter to instantly calculate the difference from the weekly peak.
  4. 4. Fill the formula down: Drag the fill handle at the bottom right of the cell to apply the calculation to the rest of the column dynamically.
100% compatible with Microsoft Excel formats (.xlsx) and functions.Fully supports advanced conditional formulas like MAXIFS, COUNTIFS, and SUMIFS.Lightweight software that processes large data sets quickly without lagging.Built-in data visualization tools to easily chart your peak variances.
QA img-9

Frequently Asked Questions

Why is my MAXIFS formula returning a #NAME? error?

The #NAME? error typically occurs if you are using an older version of Excel (like Excel 2016 or earlier) that does not support the MAXIFS function. To fix this, you must either upgrade your software or use the MAX(IF()) array formula alternative.

How can I make my MAXIFS formula update automatically when I add new daily rows?

To make formulas automatically expand, you should convert your data into an Excel Table. Select any cell within your data and press Ctrl+T. Then, rewrite your formula using structured references (for example: =[@Amount]-MAXIFS([Amount],[Week],[@Week])). The ranges will automatically adjust when new data is pasted below.

Can I automatically highlight the highest weekly amount instead of calculating variance?

Yes, you can use Conditional Formatting to highlight peaks. Select your Amount column, navigate to Conditional Formatting > New Rule > Use a formula to determine which cells to format, and enter the formula =$D2=MAXIFS($D$2:$D$1000,$A$2:$A$1000,$A2). Set your preferred fill color, and it will highlight the maximum value for each week.