How to Average Excel Cells Skipping Alternating Columns and Zeros
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.
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.
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.
Click the cell where you want the calculated average to appear.
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.
Press Ctrl + Shift + Enter to apply it as an array formula. Curly braces {} will automatically appear around the formula if entered correctly.

Use AVERAGEIF for Contiguous Ranges
If you are able to reorganize your data to group the enrollment columns together, a simpler function can be used to ignore zeroes.
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. Open your data file: Launch WPS Spreadsheet and open your existing workbook containing the alternating data columns.
- 2. Select your calculation cell: Click on the specific empty cell where you want the final average value to be displayed.
- 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. Execute the formula: Press Ctrl + Shift + Enter to instantly calculate your precisely filtered average.

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.




