+ Reply to Thread
Results 1 to 9 of 9

Re: How to sum every 12th cell in my data

  1. #1
    Registered User
    Join Date
    03-04-2015
    Location
    Texas
    MS-Off Ver
    2007
    Posts
    23

    Re: How to sum every 12th cell in my data

    I googled this and I thought I found the answer, but I seem to be doing it wrong. I need sums for values of every month through a number of years (you can see an example that I have attached) and I thought I could use:

    =SUMPRODUCT($U$3:$U$1500*(MOD(ROW($U$3:$U$1500),12)=1))

    And then to get the next month / row, ...

    =SUMPRODUCT($U$3:$U$1500*(MOD(ROW($U$3:$U$1500),12)=1))

    And so on ...

    But it seems as though the result for every version of it is the same value (see screenshot).

    Can you see what I am doing wrong?

    Example3.jpg

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How to sum every 12th cell in my data

    Images are a bit difficult for us to work with....sample files are better.

    Just looking at your formula, I think you'd need a way to increment the MOD value.
    Try something like this, copied down:
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    03-04-2015
    Location
    Texas
    MS-Off Ver
    2007
    Posts
    23

    Re: How to sum every 12th cell in my data

    I'm not sure I understand - will rows($2:2) tell it to start at row 2? And then I'd change that to ($3:3) and so on?

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How to sum every 12th cell in my data

    No...
    ROWS($2:2) initially resolves to 1...then, when copied down,
    ROWS($2:3) returns 2
    ROWS($2:4) returns 3
    ...etc

    Those values are compared to what the MOD function calculates, thereby matching on every 12 row...but, matching different sets each time.

  5. #5
    Registered User
    Join Date
    03-04-2015
    Location
    Texas
    MS-Off Ver
    2007
    Posts
    23

    Re: How to sum every 12th cell in my data

    Ok, I think I am very close to this working but I am not 100% (quite literally)

    1. All the sums should add up to the total column sum, but they seem to only add up to 98.78%

    2. I am not CERTAIN which month is being tabulated by each formula. You can see this more clearly in the screenshot but basically I have data starting on Row 14 (Jan) and then Feb on row 15 so on ... this repeats every 12 rows.

    Will ...

    =SUMPRODUCT($U$2:$U$1512*(MOD(ROW($U$2:$U$1512),12)=ROWS($2:2)))

    ... use the 12th row from the beginning (row 12), the 12th row from row 2 (row 14 or Jan) or ... what?

    Sorry, I'm sure this is a painfully ignorant question.

    Example3.jpg

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How to sum every 12th cell in my data

    The formula is summing U14 and U26 etc. The first cell is U14 because your data starts in U3. With U3 being the first value, the 12th value is U14. (Count them if you like) The next values are in U26, U36, U48 etc.

    I prefer to use this form of the formula because I just find it easier. (entered in T3)
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If Ron Coderre's formula was written like this and entered in W3 the Rows($2:3) would be equivalent to the 2 that I used. As you can see the results are identical. It is just a matter of choice.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Column V has the result of the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    T
    U
    V
    W
    3
    120
    1
    3
    120
    4
    2
    4
    5
    3
    5
    6
    4
    6
    7
    5
    7
    8
    6
    8
    9
    7
    9
    10
    8
    10
    11
    9
    11
    12
    10
    0
    13
    11
    1
    14
    12
    2
    15
    13
    3
    16
    14
    4
    17
    15
    5
    18
    16
    6
    19
    17
    7
    20
    18
    8
    21
    19
    9
    22
    20
    10
    23
    21
    11
    24
    22
    0
    25
    23
    1
    26
    24
    2
    27
    25
    3
    28
    26
    4
    29
    27
    5
    30
    28
    6
    31
    29
    7
    32
    30
    8
    33
    31
    9
    34
    32
    10
    35
    33
    11
    36
    34
    0
    37
    35
    1
    38
    36
    2
    39
    37
    3
    40
    38
    4
    41
    39
    5
    42
    40
    6
    43
    41
    7
    44
    42
    8
    45
    43
    9
    46
    44
    10
    47
    45
    11
    48
    46
    0
    49
    47
    1
    50
    48
    2
    51
    49
    3
    Last edited by newdoverman; 09-24-2015 at 07:58 PM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  7. #7
    Registered User
    Join Date
    03-04-2015
    Location
    Texas
    MS-Off Ver
    2007
    Posts
    23

    Re: How to sum every 12th cell in my data

    I'm sorry, I'm still having trouble. I seem to get results for 11 months but I can't make the 12th one work. I tried a couple of things ... what was suggested first was a series like this ...

    Please Login or Register  to view this content.
    But the final one (ROWS($2:13)) does not work and gives me "0" as a result.

    I thought the "13" might be the problem, so I tried:

    Please Login or Register  to view this content.
    But then two of the formulas give identical results and I still can't get the last month.

    You can see in the attached screenshot how I compared a simple sum to the formula to match the months correctly to their formulas.

    Is it obvious what I am doing wrong?
    Example4.jpg

  8. #8
    Registered User
    Join Date
    03-04-2015
    Location
    Texas
    MS-Off Ver
    2007
    Posts
    23

    Re: How to sum every 12th cell in my data

    I also just tried this series, as suggested by newdoverman:

    Please Login or Register  to view this content.
    But the one that represents November in my set (code below) ...

    Please Login or Register  to view this content.
    ... is the one that will not work. I get a "0" result.

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How to sum every 12th cell in my data

    Here is a modification of the formula that I gave you which relies upon the values produced by this formula that gives a value for each month:
    Enter this in column Z3 (January) and copy down for 12 rows in total:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This gives January 3, February 4, March 5, April 6 etc. until October is 0 then November is 1 and December is 2.

    Enter this in W3 and fill down 12 rows:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This formula will give you the same results. Enter in W3 and fill down for a total of 12 rows. This SUMIF just sums the values for each month.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Easiest of all is a Pivot table.

    I have shown in column Q the repetition of values produced by the MOD formula.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] add 1 after the 12th month
    By ammartino44 in forum Excel General
    Replies: 4
    Last Post: 04-09-2015, 07:24 PM
  2. how to plot every 12th cell in a row, into a chart
    By dantastic in forum Excel General
    Replies: 2
    Last Post: 12-22-2011, 01:12 PM
  3. Return Text String Through 12th Space
    By Eddiegnz1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-18-2007, 06:45 PM
  4. Calculating the average of every value in every, say, 12th cell
    By vsnellman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-28-2006, 04:46 PM
  5. [SOLVED] any formula to auto calculate 1st-12th is 12 days pls?
    By Kelly Lim in forum Excel General
    Replies: 13
    Last Post: 06-17-2006, 04:30 AM
  6. [SOLVED] Calendar 1st month ok but 2nd to 12th how.
    By Steved in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-28-2005, 07:05 PM
  7. [SOLVED] rounding to next 12th
    By Amie Barnes in forum Excel General
    Replies: 1
    Last Post: 01-21-2005, 01:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1