Share via

every nth row count

Anonymous
2012-09-18T13:36:56+00:00

This is a repeat because my 1st post was stupidly written.

I want to count every 4th row ONLY if it has a date in it) starting with D7, ie;   (D7, D11, D15, D19  skips D23 because no date , D27) so far the answer would be 5.

Count each sell as 1 and total as it counts.

Range D7:D1000

Thanks and I'm sorry for the repeat.

Mark

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-09-18T14:01:06+00:00

If, by having a date means not empty:

=SUMPRODUCT((MOD(ROW(D7:D1000)-6,4)=1)*(D7:D1000<>""))

If, the cells could have text and not have a date:

=SUMPRODUCT((MOD(ROW(D7:D1000)-6,4)=1)*(D7:D1000<>"")*NOT(ISERROR(WEEKDAY(D7:D1000))))

Was this answer helpful?

0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-09-18T15:43:20+00:00

    Format the cell with the formula as general or as a number with no decimal places. It is formatted as a date, and you are using the 1904 date system.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-09-18T14:42:21+00:00

    These formulas in this response gives me an answer of 1/2/1904 )(In S5)when I enter a date in D7 of 1/1/2013.

    I want it to return the answer "1" and then 2 if there is a date in D11. etc.

    Don't count cells with no date.

    Maybe I am not applying the formula correctll.

    I APOLOGISE for my ignorance

    CORRECTION:  These work if I hit my designated cell and Hit paste special.  Is that the way I get the formula in there?

    Thanks for the answers guys, i'm not sure how I get myself in these messes.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2012-09-18T14:12:18+00:00

    Based on your previous post and Mike H.'s response in which he just didn't catch the need to test for a date in D, both of these work for me:

    =SUMPRODUCT(--(MOD(ROW(D7:D1000),4)=3),--(D7:D1000>0))

    or

    =SUMPRODUCT(--(MOD(ROW(D7:D1000),4)=3),--(D7:D1000<>""))

    Bernie's works also (but that's no surprise).

    Was this answer helpful?

    0 comments No comments