Counting specific values in every 4th row

Dainer

New Member
Joined
Dec 25, 2017
Messages
5
Hello

I need help in finding the formula to count specific values in every 4th row.
For example, I need to count how many numbers "1" are in row 2), 6) and 10) total (in this case result should be "3")
Later I need to do the same thing separately for numbers 2...75.
Counting how many number "1" including every row was simple.
Why I need automation for every 4th row is, that my table consists of nearly 1000 rows.

Thank you in advance for helping!

Example table below:

B C D E F G H
2)
1
2456711
3)
3543526166
4)
10172324252932
5)
6)
1
234131416
7)
15
32334763
8)
5
8921244344
9)
10)
1
3711151920
11)
1018252831
12)
4
91224273236

<colgroup><col style="mso-width-source:userset;mso-width-alt:1462; width:30pt" span="8" width="40"> </colgroup><tbody>
</tbody>
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Thank you for quick reply.

It returns with pop-up error window (i pressed ctrl+shift+enter) also tried just enter, same effect.
After clicking ok, it highlights ",4" part of the formula (if that helps)
 
Upvote 0
Thank you for quick reply.

It returns with pop-up error window (i pressed ctrl+shift+enter) also tried just enter, same effect.
After clicking ok, it highlights ",4" part of the formula (if that helps)

=SUM(IF(MOD(ROW($B$2:$H$12)-ROW($B$2),4)=0,IF($B$2:$H$12=1,1)))

must be confirmed with control+shift+enter, which means: Press down the control and the shift keys at the same time while you hit the enter key. If done properly, Excel itself puts a pair of { and } around the formula in recognition.

If you are on a non-American system, you might need to replace comma's with semi-colons.
 
Upvote 0
changing , to ; worked. Thanks.

Now to do the same thing for other numbers I simply change number "1" to number "n"?
In case of number "2" ...($B$2:$H$12=1;1) becomes ...($B$2:$H$12=2;2) ?
 
Upvote 0
Tried, I think for number "2" it should be ($B$2:$H$12=2;1)
Otherwise it counts each "2" twice.
Correct?
 
Upvote 0
changing , to ; worked. Thanks.

Now to do the same thing for other numbers I simply change number "1" to number "n"?
In case of number "2" ...($B$2:$H$12=1;1) becomes ...($B$2:$H$12=2;2) ?

Last 1 is returned whenever the two conditions are met and the outer SUM sums those 1's.

Tried, I think for number "2" it should be ($B$2:$H$12=2;1)
Otherwise it counts each "2" twice.
Correct?

Correct...
 
Upvote 0

Forum statistics

Threads
1,215,136
Messages
6,123,251
Members
449,093
Latest member
Vincent Khandagale

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