Calculation Issues

Divide the Sum of One Excel Range by Another

Algirdas JasaitisAlgirdas Jasaitis Nov 18, 2026 868 views

Question details

Calculate the ratio of the sum of AJY9:AKD9 to the sum of AJY17:AKD17, with optional error handling.

Divide the Sum of One Excel Range by Another
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants to divide the total of one row range by the total of another row range.
Observed behavior
The desired result is a ratio calculated from the two range totals, with an option to return zero if an error occurs.
Before you start

Check that AJY9:AKD9 and AJY17:AKD17 contain the values you want to total. Choose an empty cell outside those ranges for the formula.

Solution 1Recommended

Divide the two range totals with SUM

Use this formula to calculate the ratio and show any calculation errors.

1
Select the result cell

Click an empty cell outside AJY9:AKD9 and AJY17:AKD17.

2
Enter the formula

Type =SUM(AJY9:AKD9)/SUM(AJY17:AKD17) in the cell or formula bar, then press Enter.

Divide the two range totals with SUM
Zero denominator: If the sum of AJY17:AKD17 is zero, Excel displays a #DIV/0! error.
Calculate ratios in WPS Spreadsheets

Divide Range Totals in WPS Spreadsheets

Use SUM to divide the totals of two ranges in WPS Spreadsheets, and add IFERROR if you want errors to return zero.

  1. 1. Open the workbook: Open WPS Spreadsheets and use Open to select your workbook.
  2. 2. Select a result cell: Click an empty cell outside the two source ranges.
  3. 3. Enter the ratio formula: Type =SUM(AJY9:AKD9)/SUM(AJY17:AKD17) and press Enter.
  4. 4. Add error handling if needed: To return zero for errors, replace the formula with =IFERROR(SUM(AJY9:AKD9)/SUM(AJY17:AKD17),0) and press Enter.
Calculate ratios from range totals with SUM.Use IFERROR to return zero when the calculation produces an error.Open and edit Microsoft Excel XLSX files.Work in a familiar spreadsheet interface.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the formula show #DIV/0!?

The sum of AJY17:AKD17 is zero, so Excel cannot divide by it. Check the values in that range or use IFERROR to return zero instead.

How can I show the ratio as a percentage?

Select the result cell and choose Home > Percent Style. The underlying ratio remains unchanged.

Does IFERROR hide errors other than division by zero?

Yes. IFERROR returns the specified fallback for any error in the formula, including errors originating in the source ranges.

Can I use the same formula in WPS Spreadsheets?

Yes. Enter =SUM(AJY9:AKD9)/SUM(AJY17:AKD17) in an empty cell in WPS Spreadsheets, or wrap it in IFERROR to return a fallback value.