+ Reply to Thread
Results 1 to 8 of 8

Sum of Columns when criteria is met?

  1. #1
    Registered User
    Join Date
    01-16-2009
    Location
    Darlington, England
    MS-Off Ver
    Excel 2003
    Posts
    18

    Sum of Columns when criteria is met?

    As requested, a thread to hopefully resolve an issue I'm having.

    I need a formula that will do the following:

    1) If B1:2008 is "EA" (and so on for about 7 other classes) then count how many days are entered in G8:2008 so a cell on a seperate distribution sheet tells me how many sickness days in total have been taken by EA's (and then the same for the other classes).

    I can't seem to get a method that works. Help very muc appriciated!
    Last edited by Iscariot; 02-27-2009 at 08:33 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sum of Columns when criteria is met?

    So can you use SUMIF ?

    =SUMIF(Sheet!B1:B2008,"EA",Sheet1!G8:G2008)

    If you have multiple criteria that you wish to aggregate you can use:

    =SUM(SUMIF(Sheet1!B1:B2008,{"EA","EX","ZY","DV"},Sheet1!G8:G008))

  3. #3
    Registered User
    Join Date
    01-16-2009
    Location
    Darlington, England
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Sum of Columns when criteria is met?

    ...Can't believe I didn't try sumif. I essentially tried to go too complex, using the method you showed me previously about creating a refence cell for the whole range. Simplist way never occured to me. Thanks Donkey :D

    One last thing and then hopefully I'll finally be finished with this, is that at the moment on the Database, if someone has multiple sicknesses they're entered multiple times, so each one counts as a seperate period of absence - Is there anyway to create a formula that would be able to count the number of people in each grade who have been sick, ignoring multiples of the same person?

    So if Column A for example looked like this

    Mawdesley
    Hancock
    Hall
    Hall
    Hall
    Hall
    Hall
    Allott
    Allott
    Cranston
    Cranston

    ...and they were all EA's, the total would be 5. Is that possible, as on this one I just don't have a clue. Thanks in advance!

    =I=

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sum of Columns when criteria is met?

    Assuming Names in A and EA etc in B:

    Please Login or Register  to view this content.
    This assumes however that any given named is associated with 1 area, eg "EA"... ie relationship between A:B is 1:1 ... if not a different approach would be required.

  5. #5
    Registered User
    Join Date
    01-16-2009
    Location
    Darlington, England
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Sum of Columns when criteria is met?

    Tried Sumproduct, not getting any kind of result.

    I don't expect the same (awesomely legendary) effort of last time, but I've attached a sample so you can see the layout and setup as I imagine it'll help seeing the relationship between collumns.

    Relevent columns on the Master_Data sheet are A,B,C & F, and the area I'm looking at putting the formula is on the Breakdown sheet, cells highlighted in yellow.

    As I said, I don't expect you to write the whole thing, but if you could take a look and see a way I could do what I'm after, I'd be extremely grateful.

    Grateful as always,

    =I=

    EDIT: It keeps coming up with a database error when I try and upload this attachment, won't be a sec.
    Last edited by Iscariot; 02-27-2009 at 07:06 AM.

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sum of Columns when criteria is met?

    No attachment.

  7. #7
    Registered User
    Join Date
    01-16-2009
    Location
    Darlington, England
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Sum of Columns when criteria is met?

    It's not having it, have refreshed and such repeatedly and tried attaching to a reply rather than editing in, it's just contactly having error messages. It's small enough so I assume it's a site problem at the moment. If you PM me your email address I can email you the sample, or I can try again later, whatever is best for you really Donkey.

  8. #8
    Registered User
    Join Date
    01-16-2009
    Location
    Darlington, England
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Sum of Columns when criteria is met?

    As always, Donkey came up with the solution so a big thanks again to Donkey for all your help, you're a true gem of the community!

    =I=

+ 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