+ Reply to Thread
Results 1 to 5 of 5

Sum individual dated cells into corresponding weeks

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-06-2011
    Location
    cleveland
    MS-Off Ver
    Excel 2007
    Posts
    225

    Sum individual dated cells into corresponding weeks

    refer to attached spreadsheet for my (unefficient) solution to the problem i have at hand where i want to sum the data into weekly totals based off of their assigned day #.

    sumif week example(2).xlsx

    i have gotten it to work but when the spreadsheet gets large, the processing time bogs down on slower computers and it just looks like plain garbage.

    here is the code i used to sum the first seven days in to week 1

    =SUMIF(B:B,B2*7-0,D:D)+SUMIF(B:B,B2*7-1,D:D)+SUMIF(B:B,B2*7-2,D:D)+SUMIF(B:B,B2*7-3,D:D)+SUMIF(B:B,B2*7-4,D:D)+SUMIF(B:B,B2*7-5,D:D)+SUMIF(B:B,B2*7-6,D:D)

    day 1 is in cell b2, so i have it to sumif based on each particular day as a separate statement and then just add them all up. is there a more elegant solution i could use?

    i am using excel 2007 but will also be putting this in google spreadsheets if that matters

    thank you for at least looking into it - you all have been so very helpful to me as it stands - i am very appreciative
    Last edited by NBVC; 12-21-2011 at 11:37 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: sum individual dated cells into corresponding weeks

    Not sure about more efficient... .SUMIF is already very efficient.. but here is another way:

    =SUM(SUMIF(B:B,B2*7-{0,1,2,3,4,5,6},D:D))

    I am not sure if that would work in GoogleDocs though.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    01-06-2011
    Location
    cleveland
    MS-Off Ver
    Excel 2007
    Posts
    225

    Re: sum individual dated cells into corresponding weeks

    yeah it is only reading day 7 with that formula in docs but at least now i have something better to go off of for future excel only projects. thank you again

  4. #4
    Forum Contributor
    Join Date
    01-06-2011
    Location
    cleveland
    MS-Off Ver
    Excel 2007
    Posts
    225

    Re: Sum individual dated cells into corresponding weeks

    =arrayformula(SUM(SUMIF(B:B,B2*7-{0,1,2,3,4,5,6},d:d)))

    worked in google docs. thank you for help me coding is so much cleaner now

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sum individual dated cells into corresponding weeks

    Thank you for that update...

+ 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