COUNTIF question

MaDroskilo

New Member
Joined
Dec 13, 2018
Messages
1
Hello everyone,

What I am trying to do is in a single column, count all the non-zero elements that appear in every 5th row. I tried to use the COUNTIFS function. However, the second criterion (selecting every 5th row) does not seem to work. Even when I use COUNTIF() (see below) with this single criterion, 0 is always returned.

As an example, if I would use this function --> COUNTIF(A50:A59,MOD(ROW(A50:A59),5)=0) I would expect 2 as an output. What am I missing? Or is there a more elaborate way to handle this?

Thank you in advance! :)
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi,

COUNTIF and COUNTIFS can't handle arrays like that, you'll need to use SUMPRODUCT:


Book1
ABC
5012
510
523
534
545
556
560
577
588
599
Sheet396
Cell Formulas
RangeFormula
C50=SUMPRODUCT((A50:A59<>0)*(MOD(ROW(A50:A59),5)=0))
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,698
Members
448,979
Latest member
DET4492

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