Function Problems

How to Average Excel Cells Skipping Alternating Columns and Zeros

Phi Hung VoPhi Hung Vo Oct 22, 2026 869 views

Question details

The user needs to calculate the average of enrollment data spread across alternating columns, explicitly excluding zero values representing future months.

Product
Spreadsheet
Device & OS
not provided
Scenario
Calculating averages in a worksheet where data categories alternate column by column, and future unrecorded data points are marked as zero.
Observed behavior
Standard AVERAGE functions include zeroes, which skews results, and cannot natively skip every other column without a complex formula.
Before you start

Identify the exact range of your data and note your starting column to ensure the formula accurately targets your enrollment numbers rather than course numbers.

Solution 1Recommended

Use an Array Formula to Skip Columns and Exclude Zeros

This is the most robust method to simultaneously skip every other column and exclude zero values in a single operation.

This approach combines several functions to filter the data array. The COLUMN function determines the numerical position of the cell, while the MOD function checks if the column is an alternating one (e.g., every second column). Finally, the IF condition ensures the cell value is strictly greater than zero before including it in the AVERAGE calculation.

1
Select the target cell

Click the cell where you want the calculated average to appear.

2
Enter the array formula

Type the formula =AVERAGE(IF((MOD(COLUMN(D2:AA2)-COLUMN(D2),2)=0)*(D2:AA2>0),D2:AA2)). Adjust D2:AA2 to match the exact span of your worksheet's data range.

3
Apply the array calculation

Press Ctrl + Shift + Enter to apply it as an array formula. Curly braces {} will automatically appear around the formula if entered correctly.

Use an Array Formula to Skip Columns and Exclude Zeros
Array Formula Requirement: In legacy versions of spreadsheet software, simply pressing Enter will result in an error. You must use the Ctrl+Shift+Enter shortcut to execute the array correctly.

Calculate Complex Data Arrays Easily with WPS Spreadsheet

WPS Spreadsheet natively supports advanced array formulas, making it simple to process complex data layouts like alternating columns while seamlessly handling zero values.

  1. 1. Open your data file: Launch WPS Spreadsheet and open your existing workbook containing the alternating data columns.
  2. 2. Select your calculation cell: Click on the specific empty cell where you want the final average value to be displayed.
  3. 3. Input the array formula: Type your formula, such as =AVERAGE(IF((MOD(COLUMN(D2:AA2)-COLUMN(D2),2)=0)*(D2:AA2>0),D2:AA2)) into the formula bar.
  4. 4. Execute the formula: Press Ctrl + Shift + Enter to instantly calculate your precisely filtered average.
100% compatible with Microsoft Excel formulas (.xlsx)Native support for advanced array functions like AVERAGE, MOD, and COLUMNLightweight application that performs complex calculations instantly
microsoft office alternative - wps office

Frequently Asked Questions

Why is my standard average function calculating zeros?

The standard AVERAGE function includes all numerical values in your selected range, including zeros. To exclude them, you must use conditional formulas like AVERAGEIF or embed an IF function requiring criteria like ">0".

What does the MOD function do in this specific formula?

The MOD function returns the remainder after division. By dividing the relative column number by 2 and checking if the remainder is zero, the formula identifies every second column. This allows the function to selectively skip the intervening columns.

Can I use SUM and COUNTIF instead of AVERAGEIF?

Yes. The combination formula =SUM(D2:P2)/COUNTIF(D2:P2,">0") effectively divides your total sum by the count of non-zero cells. This yields the exact same average result as AVERAGEIF but provides a clear view of the mathematical breakdown.