+ Reply to Thread
Results 1 to 17 of 17

sum cells based on specific criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    01-04-2013
    Location
    colorado
    MS-Off Ver
    Excel 2010
    Posts
    7

    sum cells based on specific criteria

    I am attempting to create a log to record and compile cycling information. my intention is to have a row for each day of the year, with date and day listed in separate columns. next, i will record length of each ride, miles ridden, elevation gain, etc. I then want excel to sum each category for each month as well as for each week. no problem if except that i want this to be easily repeatable each year without having to cut and paste all the formulas to reflect new cells as the days of the week rotate through. is there a way to get excel to check for the day of the week in one cell, and then to add the next several cells so that i get cumulative info for that week?
    so if column A has date, Column B has day of week, maybe cell B5 is a monday. can i get Excel to then check column B for "Monday" and then add the contents of C5 plus the next 6 cells in Column C? not sure if i made this very clear, hopefully someone can help. Thanks!!

  2. #2
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: sum cells based on specific criteria

    Yes you can. In fact I have something very similar set up already that I will post here shortly.
    It should fit your needs mostly, if not fully.

    Give me a few minutes to find it.
    If I've been of help, please hit the star

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: sum cells based on specific criteria

    You can use pivot table to get the result you want.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: sum cells based on specific criteria

    Sorry for the delay, I had to find which of the computers this was on and then had to tidy it up a little.

    It's a very basic thing but should be easily adapted to fit your needs.

    Happy to help with that if you so desire.

    S.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-04-2013
    Location
    colorado
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: sum cells based on specific criteria

    I rarely use excel, so am really struggling to get this the way i want it. i kind of understand the logic of some of it, but struggle with other aspects.

    Here's what i have so far, if you could look at it that would be great!
    i decided an easy work-around for the week was to enter date based on first Monday of new year, then add-subtract from that to keep it consistent.
    i think this is the same question i asked earlier, but now applied instead to the months. if you look at the sheet titled "summaries" you will see that i used to go in and manually change the cells that it added for each month. i could still do that, but i'd rather have a way for it to query for january 1st, then add up the correct cells in the range for that stat, and so on. in your sheet, i wasn't sure how to follow your function (i know, probably simple for people who use the program a lot). so not sure how to use it in this application.
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: sum cells based on specific criteria

    =SUMIFS('Ride Log'!$H$4:$H$374,'Ride Log'!$F$4:$F$374,">="&A3,'Ride Log'!$F$4:$F$374,"<="&EOMONTH(A3,0))

    The above would be your formula in cell B3 of the Summaries worksheet, and copied down to the other months.

    I know it looks like gibberish if you're not used to reading Excel formulas but it's quite simple really.

    Syntax in simple to read terms would be =SUMIFS(RangeToSum,RangeToTest1,Condition1,RangeToTest2,Condition2) You can have more than two conditions so you would just add them as needed.

    Basically, in plain English, the formula above says "Sum the figures in column H on 'Ride Log' where the corresponding date in column F is greater than or equal to the 1st Jan and less than or equal to the last day in Jan".

    Does that make it any clearer????
    I suspect not...

  7. #7
    Registered User
    Join Date
    01-04-2013
    Location
    colorado
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: sum cells based on specific criteria

    Quote Originally Posted by Spencer101 View Post
    =SUMIFS('Ride Log'!$H$4:$H$374,'Ride Log'!$F$4:$F$374,">="&A3,'Ride Log'!$F$4:$F$374,"<="&EOMONTH(A3,0))

    The above would be your formula in cell B3 of the Summaries worksheet, and copied down to the other months.

    I know it looks like gibberish if you're not used to reading Excel formulas but it's quite simple really.

    Syntax in simple to read terms would be =SUMIFS(RangeToSum,RangeToTest1,Condition1,RangeToTest2,Condition2) You can have more than two conditions so you would just add them as needed.

    Basically, in plain English, the formula above says "Sum the figures in column H on 'Ride Log' where the corresponding date in column F is greater than or equal to the 1st Jan and less than or equal to the last day in Jan".

    Does that make it any clearer????
    I suspect not...
    ok. it looks like i then change the H twice to the appropriate column for each of my other data? so I for Time, L for elevation, and O for TSS score, and everything else would stay the same?

  8. #8
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: sum cells based on specific criteria

    Quote Originally Posted by mrcookie View Post
    ok. it looks like i then change the H twice to the appropriate column for each of my other data? so I for Time, L for elevation, and O for TSS score, and everything else would stay the same?
    Yup. Exactly that.
    See, easy really isn't it?

  9. #9
    Registered User
    Join Date
    01-04-2013
    Location
    colorado
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: sum cells based on specific criteria

    and i'm assuming i would have to change the condition for each month? i'm having trouble picking that out....

  10. #10
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: sum cells based on specific criteria

    Nope. Just copy the formulas down and they will automatically adjust to each month.

  11. #11
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: sum cells based on specific criteria

    Here's your file back with the formulas added to the table on the Summaries worksheet.

    Let me know if you need more help on this.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    01-04-2013
    Location
    colorado
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: sum cells based on specific criteria

    I sure appreciate you walking me through this! i cut and pasted your formula, then filled down (is that the same as copy down?) when i added test numbers, it doesn't do anything. would you mind looking at it again here?
    Attached Files Attached Files

  13. #13
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: sum cells based on specific criteria

    Sorry, my bad, you need to change the months on the Summaries tab to show month and year. So type Jan13 into cell A3 and copy down to A14.
    It will look like:
    Jan-13
    Feb-13
    Mar-13 etc. Then it should work for you.

  14. #14
    Registered User
    Join Date
    01-04-2013
    Location
    colorado
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: sum cells based on specific criteria

    hmmmm. still didn't work.

  15. #15
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: sum cells based on specific criteria

    Worked for me...
    Have a look at the attached.
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    01-04-2013
    Location
    colorado
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: sum cells based on specific criteria

    That'll do for sure! Thanks so much for your help on this. since creating this i generally only go back once a year to modify, and always struggle to figure out how to change it. With this overhaul, it will make my life so much easier!

    rep to you, and you are certainly a gentleman and a scholar

  17. #17
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: sum cells based on specific criteria

    Any time mate. Always glad to help.

    Thanks for the rep, always appreciated.

    Happy cycling

+ 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