• Sum alternate cells (Excel 2000 SP3)

    Author
    Topic
    #432930

    Is there a convenient way to tell Excel to sum alternate cells in either rows or columns? I have 80 columns with text then a number in adjacent cells repeated 40 times in each row. I can type =SUM(B2+D2+F2+H2+J2+ . . . . . . . . +BB2 etc ) but I thought there should be a more elegant way of writing the formula.

    Thank you in anticipation of assistance in this question.

    Viewing 3 reply threads
    Author
    Replies
    • #1016786

      Since SUM ignores text (treats it as a zero), try: =SUM(B2:CB2)

    • #1016788

      =SUMPRODUCT(–(MOD(COLUMN(B2:BB2)-COLUMN(B2)+0,2)=0),B2:BB2)

    • #1016789

      If the values in A2, C2, etc. are really text, use kweaver’s formula. If there may be numbers among them:

      =SUMPRODUCT(A2:BB2,1-MOD(COLUMN(A2:BB2),2))

      • #1016799

        Hans – I appreciate very highly your response as well as the others I hope they see this response from me.

        Malcolm

      • #1022639

        >If the values in A2, C2, etc. are really text, use kweaver’s formula. If there may be numbers among them:

        =SUMPRODUCT(A2:BB2,1-MOD(COLUMN(A2:BB2),2))

        As there are numbers in the `text’ cells I have used the above formula in the form:

        =SUMPRODUCT(H4:BA4,1-MOD(COLUMN(H4:BA4),2))

        When I enter a number in I4 and press Enter the formula that is in E4 it does not respond; it continues to diplay 0 (zero). Can you see an error in the way I have used your formula?

        • #1022640

          Hi Malcolm

          I think you will need to convert the text to an integer. A nice and quick trick is to:

          1) Type 1 into a blank cell
          2) Highlight the cell
          3) Edit–>Copy
          4) Highlight calls H4 to BA4
          5) Goto the edit menu select Paste Special
          6) Select Multiply
          7) Press OK

          This will convert any numbers stored as text in the range to a number. I believe this should solve your problem.

          • #1022642

            Jerry,

            This is my original question:

            Is there a convenient way to tell Excel to sum alternate cells in either rows or columns? I have 80 columns with text then a number in adjacent cells repeated 40 times in each row. I can type =SUM(B2+D2+F2+H2+J2+ . . . . . . . . +BB2 etc ) but I thought there should be a more elegant way of writing the formula.

            In cell H4, J4, L4 etc etc through to AZ4 there can be text & as it has turned out since numbers also. I want the formula to ignore H4, J4, L4 etc etc through to AZ4. I want the formula to sum the numbers in I4, K4, M4 etc etc to BA4. that is every second cell in row 4.

            Can you help me with that aim please?

        • #1022643

          You originally stated that you wanted to add the even-numbered columns B, D, F, etc.
          Column I is an odd-numbered column (it is the 9th column), so a number in I4 will not be included in the result of the formula – according to your specification!
          If you want to add the odd-numbered columns, change the formula to

          =SUMPRODUCT(H4:BA4,MOD(COLUMN(H4:BA4),2))

    • #1016790

      Hi malcolm

      Have you tried these forulas

      To sum every other row:

      =SUMPRODUCT(MOD(ROW(A1:A100),2)*A1:A100) (odd rows)

      =SUMPRODUCT((1-MOD(ROW(A1:A100),2))*A1:A100) (even rows)

      To sum every other column:

      =SUMPRODUCT(MOD(COLUMN(A1:Z1),2)*A1:Z1) (odd columns)

      =SUMPRODUCT((1-MOD(COLUMN(A1:Z1),2))*A1:Z1) (even columns)

      Obviously change the range to suit your needs

    Viewing 3 reply threads
    Reply To: Sum alternate cells (Excel 2000 SP3)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: