+ Reply to Thread
Results 1 to 4 of 4

summing up alternate cells

Hybrid View

  1. #1
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    If your data is in B2:B201 then this should return what you want.

    =SUMPRODUCT( MOD(ROW(B2:B201)-ROW(B2),2)*B2:B201 - MOD(ROW(B3:B202)-ROW(B2),2)*B2:B201 )
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  2. #2
    Registered User
    Join Date
    05-14-2008
    Posts
    56

    sorry, did not realise

    sorry, did not realise that this problem belonged in Functions... did not even realise there was such a subforum too because i wrongly assumed that Programming included everything. my bad.

    my problem was that i didn't realise my original demo data was inadequate; it was odd in number (e.g. 5 cells), and thus when i take EVEN-ODD, it returned an error since well a blank cell can't minus a cell with data. Added another line of data and it worked fine.

    still, thanks for the functions, it definitely helps much better than my

        ActiveCell.FormulaR1C1 = _
            "=R[-108]C[14]-R[-109]C[14]+R[-106]C[14]-R[-107]C[14]+R[-104]C[14]-R[-105]C[14]+" & _
            "R[-102]C[14]-R[-103]C[14]+R[-100]C[14]-R[-101]C[14]+R[-99]C[14]-R[-98]C[14]+" & _
            "R[-97]C[14]-R[-96]C[14]+R[-94]C[14]-R[-95]C[14]+R[-92]C[14]-R[-93]C[14]+" & _
            "R[-90]C[14]-R[-91]C[14]+R[-88]C[14]-R[-89]C[14]+R[-86]C[14]-R[-87]C[14]+" & _
            "R[-84]C[14]-R[-85]C[14]+R[-82]C[14]-R[-83]C[14]+R[-80]C[14]-R[-81]C[14]+" & _
            "R[-78]C[14]-R[-79]C[14]+R[-76]C[14]-R[-77]C[14]+R[-74]C[14]-R[-75]C[14]+" & _
            "R[-72]C[14]-R[-73]C[14]+R[-70]C[14]-R[-71]C[14]+R[-68]C[14]-R[-69]C[14]+" & _
            "R[-66]C[14]-R[-67]C[14]+R[-64]C[14]-R[-65]C[14]+R[-62]C[14]-R[-63]C[14]+" & _
            "R[-60]C[14]-R[-61]C[14]+R[-58]C[14]-R[-59]C[14]+R[-56]C[14]-R[-57]C[14]+" & _
            "R[-54]C[14]-R[-55]C[14]+R[-52]C[14]-R[-53]C[14]+R[-50]C[14]-R[-51]C[14]+" & _
            "R[-48]C[14]-R[-49]C[14]+R[-46]C[14]-R[-47]C[14]+R[-44]C[14]-R[-45]C[14]+" & _
            "R[-42]C[14]-R[-43]C[14]+R[-40]C[14]-R[-41]C[14]+R[-38]C[14]-R[-39]C[14]+" & _
            "R[-36]C[14]-R[-37]C[14]+R[-34]C[14]-R[-35]C[14]+R[-32]C[14]-R[-33]C[14]+" & _
            "R[-30]C[14]-R[-31]C[14]+R[-28]C[14]-R[-29]C[14]+R[-26]C[14]-R[-27]C[14]+" & _
            "R[-24]C[14]-R[-25]C[14]+R[-22]C[14]-R[-23]C[14]+R[-20]C[14]-R[-21]C[14]+" & _
            "R[-18]C[14]-R[-19]C[14]+R[-16]C[14]-R[-17]C[14]+R[-14]C[14]-R[-15]C[14]+" & _
            "R[-12]C[14]-R[-13]C[14]"
    again, sorry, and thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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