Go Back

How to Count Cells That Contain Odd Numbers in Excel

Want to learn more about how to count cells that contain odd numbers using an Excel formula? This post will give you an overview of how to use the SUMPRODUCT formula to count those cells that contain odd numbers.

Syntax(Generic Formula) to Count Cells Using Odd Numbers

=SUMPRODUCT(--((MOD(Range,2)=1)))

The MOD function in a formula returns the remainder after performing a division operation. The divisor in this division formula is 2, so the MOD function will generate a remainder of one(1) for an odd value and will return a remainder of zero(0) for any even numbers.

The range of cells which you want to count. The double negative {–} sign converts this array into a series of 1 and 0 values.

Example and how the SUMPRODUCT works

The SUMPRODUCT function is used to multiply the corresponding components in two given arrays and returns the sum of those products. It returns the remainder when the number is divided by the divisor. The result has the same sign as divisor.

Figure 1: Example of count all cells that contain odd numbers

To count all cells that contain odd numbers, you can use the SUMPRODUCT function. In the example selected cell shown, the formula in F6 is:

=SUMPRODUCT(--((MOD(C5:C11,2)=1)))

Explanation

In the above example, the MOD(TestData,2)=0 function check whether the cell within the range containing the numbers are divisible by 2 or not.

The result stores an array like the following:

If you have a long list of data in Excel, using this method will allow you to easily count the number of cells which contain odd numbers.

Still need some help with Excel formatting or have other questions about Excel? Connect with a live Excel expert here for some 1 on 1 help. Your first session is always free. 

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

i'm trying to get columns o,p to count 3 odd & one even. as the column that count 3even & one odd.
Solved by M. W. in 17 mins
I would like cells o, p to count the three odd & one even. and the numbers I would input myself into column a. all of the other cells work as when I put all even numbers it count them. this is what I would like cells o & p to count also. I have only $ 25.00 dollars. please help me, I really thank very much.
Solved by X. Y. in 28 mins
I need to count how many odd and even numbers on column.Please help me to make formula
Solved by D. H. in 17 mins

Leave a Comment

avatar