+ Reply to Thread
Results 1 to 5 of 5

sum column by two criteria

  1. #1
    Registered User
    Join Date
    02-08-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    80

    sum column by two criteria

    Hi

    I would to sum a column but by two criteria. My data is layed out as below

    Column=C Column=F Column=G Column=H
    Multi Part Wk=1 Wk=2 Wk=3
    M 5 5 1
    M 6 10 5
    M 0 5 0
    0 0 0 0
    M 10 10 6
    0 0 0 0
    M 5 10 0

    I want to sum all "m" by week no(as i have 52 columns, 1 for each week) in following layout.

    wk1 wk2 wk3
    M 26 40 12

    Please can someone help.

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

    Re: sum column by two criteria

    Can I just clarify that you want to sum by week, so a total of all M's in week 1, then all M's in week 2 and so on?

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: sum column by two criteria

    Hi,

    =SUMIF($C:$C,"M",F:F)

    will sum all week 1. Copy across for other weeks.

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    02-08-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    80

    Re: sum column by two criteria

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    =SUMIF($C:$C,"M",F:F)

    will sum all week 1. Copy across for other weeks.

    Regards
    Hi Richard,

    Thank you for the reply.

    I just thought of some thing, don't know if you could help me tweak the formula

    My current layout is as below

    wk1 wk2 wk3
    M 26 40 12

    I thought that can it sum all "m" but check which week no is at the top and total that column (ie. i have replace wk 1 with wk2, wk 2 with wk 3 and new one is wk4)

    wk2 wk3 wk4
    M 40 12

    If you can help me tweak.

    Regards

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: sum column by two criteria

    Hi,

    Unless I'm missing something obvious you don't need to know what's at the top of the column.

    If say column F is wk1, column G, wk2 etc. with the data starting on row 2, just enter the formula I gave you in say BG2 and copy across for 52 columns.

    If you want to see the totals in rows down a column instead of in columns across a row then use

    =SUMIF(C:C,"M",OFFSET(C:C,0,ROW()-1)) on a row 2 cell and copy down.

    But it strikes me that a Pivot Table would be a more elegant solution.

    If you're still struggling then upload your workbook and explain with an example what you expect to see.
    Last edited by Richard Buttrey; 04-05-2012 at 07:29 AM.

+ 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