Odd Number Count

William53

New Member
Joined
Jul 8, 2017
Messages
37
Office Version
  1. 365
Platform
  1. Windows
I have a problem that seems impossible to fix.
I want to count the odd numbers in a range above a certain number. E.g, count the number of odd numbers in the range above 50
I have tried SUMPRODUCT with ISODD and tried COUNTIFS but none seem work.

Any help would be very much appreciated.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Ya, ISODD makes an error when it's included as an array or range.

Here is an example. Adding the + character to the range inside ISODD gets it done. But it won't work in any of the IFS functions, so just turn the TRUEs and FALSEs into 1s and 0s and add it up.

After that, you can just add conditions inside the SUM function by multiplying together arrays that make TRUEs and FALSEs.

MrExcel posts19.xlsx
CDEFGHIJ
4
59count of ODDS8count of ODDS over20
6
7Numberper rowas rangeas array
866FALSE#VALUE!FALSE
996FALSEFALSE
1066FALSEFALSE
1120FALSEFALSE
1275TRUETRUE
1345TRUETRUE
1413TRUETRUE
1540FALSEFALSE
1627TRUETRUE
174FALSEFALSE
1859TRUETRUE
1963TRUETRUE
2032FALSEFALSE
2166FALSEFALSE
2285TRUETRUE
2314FALSEFALSE
2481TRUETRUE
2554FALSEFALSE
2624FALSEFALSE
2723TRUETRUE
Sheet30
Cell Formulas
RangeFormula
C5C5=SUM(--ISODD(+C8:C27))
H5H5=SUM(ISODD(+C8:C27)*(C8:C27>J5))
E8E8=ISODD(C8:C27)
F8:F27F8=ISODD(+C8:C27)
D8:D27D8=ISODD(C8)
Dynamic array formulas.
 
Last edited:
Upvote 0
Solution
Ya, ISODD makes an error when it's included as an array or range.

Here is an example. Adding the + character to the range inside ISODD gets it done. But it won't work in any of the IFS functions, so just turn the TRUEs and FALSEs into 1s and 0s and add it up.

After that, you can just add conditions inside the SUM function by multiplying together arrays that make TRUEs and FALSEs.

MrExcel posts19.xlsx
CDEFGHIJ
4
59count of ODDS8count of ODDS over20
6
7Numberper rowas rangeas array
866FALSE#VALUE!FALSE
996FALSEFALSE
1066FALSEFALSE
1120FALSEFALSE
1275TRUETRUE
1345TRUETRUE
1413TRUETRUE
1540FALSEFALSE
1627TRUETRUE
174FALSEFALSE
1859TRUETRUE
1963TRUETRUE
2032FALSEFALSE
2166FALSEFALSE
2285TRUETRUE
2314FALSEFALSE
2481TRUETRUE
2554FALSEFALSE
2624FALSEFALSE
2723TRUETRUE
Sheet30
Cell Formulas
RangeFormula
C5C5=SUM(--ISODD(+C8:C27))
H5H5=SUM(ISODD(+C8:C27)*(C8:C27>J5))
E8E8=ISODD(C8:C27)
F8:F27F8=ISODD(+C8:C27)
D8:D27D8=ISODD(C8)
Dynamic array formulas.
Hi DRSTEELE
This worked perfectly.
I spent all day trying different combinations of formulas, so thank you, I have learnt something new for today.
 
Upvote 0

Forum statistics

Threads
1,216,031
Messages
6,128,424
Members
449,450
Latest member
gunars

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top