Counting even numbers

Trev752

New Member
Joined
Aug 15, 2022
Messages
7
Office Version
  1. 365
Platform
  1. Windows
How do you count for even numbers in a row that are less than a certain value, like less than 50 lets say.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Welcome to the MrExcel board!

Is this what you mean?

24 02 21.xlsm
ABCDEFGHIJK
1
224727292217579756682
364635986429362159961
484443442582111127265
5676767676767676767670
6469593609740768035972
755555555550
8415974634736865983
9246810121416182010
10248561583660296647512
Count
Cell Formulas
RangeFormula
K2:K10K2=COUNT(FILTER(A2:J2,(A2:J2<50)*(MOD(A2:J2,2)=0),""))
 
Upvote 0
Like this

List Item
Excel Formula:
=LET(data,EVEN(D4:D13),FILTER(FILTER(data,data<50),FILTER(data,data<50)<>0))

Count Data
Excel Formula:
=LET(data,EVEN(D4:D13),COUNT(FILTER(FILTER(data,data<50),FILTER(data,data<50)<>0)))


1708488148292.png
 
Last edited:
Upvote 0
Welcome to the MrExcel board!

Is this what you mean?

24 02 21.xlsm
ABCDEFGHIJK
1
224727292217579756682
364635986429362159961
484443442582111127265
5676767676767676767670
6469593609740768035972
755555555550
8415974634736865983
9246810121416182010
10248561583660296647512
Count
Cell Formulas
RangeFormula
K2:K10K2=COUNT(FILTER(A2:J2,(A2:J2<50)*(MOD(A2:J2,2)=0),""))

Thats perfect, thanks. I keep forgetting about the Mod function. really appreciate it.
 
Last edited by a moderator:
Upvote 0
Here is another formula that I think does what you want (note - the 5 is your 50 divided by 10)...
Excel Formula:
=SUM(COUNTIF(A2:J2,SEQUENCE(5,,0,10)+{0,2,4,6,8}))
 
Upvote 0
Here is another formula that I think does what you want (note - the 5 is your 50 divided by 10)...
Excel Formula:
=SUM(COUNTIF(A2:J2,SEQUENCE(5,,0,10)+{0,2,4,6,8}))
If using a sequence approach, this seems to me to be simpler and more obviously related to the required conditions.
Excel Formula:
=SUM(COUNTIF(A2:J2,SEQUENCE(50/2,,0,2)))

Here is another pretty short one too
Excel Formula:
=SUM(ISEVEN(-A2:J2)*(A2:J2<50))
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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