Home » excel » excel – Skipping cells in IF/CountIf

excel – Skipping cells in IF/CountIf

Posted by: admin May 14, 2020 Leave a comment


I made this formula:


It works fine, but I need the COUNTIF to skip 5 cells whenever I drag it down. So D5:D8 would be D10:D13 the next cell, then D15:D18 and so on. I can’t figure out how to do this and I really don’t want to manually change 170+ cells.
If anyone could help I would really appreciate it.

How to&Answers:

If you add a helper column next to your formula that runs in increments of 5, you can use OFFSET to get a drag down that would constantly offset the way you want: (J1 would be your helper column)


This could also be bootlegged in the formula using (ROW(Reference on this Row)-Starting Row of Formula)*5



As @Wedge pointed out, OFFSET with ROWis a good way to go:


However, OFFSET is a volatile function. It will slow down your workbook if you overuse it.

You can avoid this by using INDEX instead:



This is untested but I believe the following should do the trick:

=IF(COUNTIF(INDIRECT("D" & (ROW(I1)-1)*5+5):INDIRECT("D" & (ROW(I1)-1)*5+8),">0")<>H5,"Yes","No")

Assumptions: the formula is in column I and starts at I1 you may need to adjust the -1 after the row