How to Use Excel IF and MAX Formula to Repeat the Maximum Value
Question details
The user wants to carry a peak value forward through a dataset by repeating the maximum value in subsequent rows once it is reached.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Managing numerical data where a peak value needs to be tracked and continuously displayed in adjacent rows once the overall maximum of the column is encountered.
- Observed behavior
- The user requires a logical formula that stops updating with current row values and instead locks onto the highest overall value to repeat it downwards through the rest of the table.
Ensure your data set is organized in a continuous column format, and note the exact starting cell to avoid circular reference errors when writing the formula.
Use a Combined IF and MAX Formula
Apply a logical IF statement combined with the MAX function to check if the maximum value has been reached and repeat it for the remaining rows.
This solution works by constantly checking the value in the cell immediately above the current formula cell. If that value matches the maximum value of your entire data column, the formula simply repeats it. If not, it pulls the current row's data.
Identify the column containing your numerical data (for example, Column B). Ensure your target output column is adjacent (for example, Column C).
Click on the cell where you want the conditional output to begin (e.g., C2). Type the exact formula: `=IF(C1=MAX(B:B),C1,B2)`.
Press Enter to apply the formula. Click the small square at the bottom-right corner of cell C2 and drag the fill handle down to apply this logic to the remaining rows in your dataset.

Effortlessly Manage Complex Formulas with WPS Spreadsheet
WPS Spreadsheet fully supports Excel's IF and MAX functions, allowing you to easily manage data trends and carry peak values forward without any syntax errors.
- 1. Open your dataset in WPS Spreadsheet: Launch WPS Office, open the Spreadsheet application, and load your data file.
- 2. Input the IF and MAX formula: Select your target output cell (e.g., C2) and input the formula `=IF(C1=MAX(B:B),C1,B2)`.
- 3. Drag to fill: Use the fill handle located at the bottom right of the active cell to drag the formula down through your entire dataset.
- 4. Analyze your peak values: Review the newly generated column to ensure the maximum value is correctly carried forward once reached.

Frequently Asked Questions
Why does my MAX formula return 0 instead of the highest number?
This typically happens if the referenced range contains text instead of numbers, or if the numbers are accidentally formatted as text. Select your data column, right-click, choose 'Format Cells', and ensure the format is set to 'Number'.
Can I use this formula to find the maximum value dynamically in a growing list?
Yes, by referencing the entire column (like B:B in the formula), the MAX function will automatically include and evaluate any new numerical data you add to the bottom of that column.
How do I stop the formula from returning zeros in blank rows?
You can nest another IF function to check for blanks before evaluating the MAX condition. For example, use `=IF(ISBLANK(B2), "", IF(C1=MAX(B:B),C1,B2))` to keep the output cell empty if the corresponding source cell has no data.




