+ Reply to Thread
Results 1 to 7 of 7

Sum Mutliple criteria Using the mid Function

  1. #1
    Registered User
    Join Date
    01-29-2008
    Posts
    68

    Sum Mutliple criteria Using the mid Function

    Please refer to attachment for specific data
    I need two formulas, one to sum hours or dollars based on each specific discipline while excluding cost codes for that discipline where the cost code at =mid(cost code,4,3) which will be 888. The second one will sum all the 888 for each discipline.

    I was trying to use a sumproduct which has worked well in multiple criteria sums but I can't figure out how to use the mid formula along with it.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Sum Mutliple criteria Using the mid Function

    Okay, what defines a discipline? Once we figure that out, then you want all hours or dollars (which is it? both?) summed for that discipline unless the cost code contains 888 as the 4-6 characters?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

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

    Re: Sum Mutliple criteria Using the mid Function

    I would add a helper column to pull the code out.

    e.g.

    =MID(A2,4,3) copied down

    Then create pivot tables for each so that the unique values are pulled and summed.

    http://peltiertech.com/Excel/Pivots/
    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.

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

    Re: Sum Mutliple criteria Using the mid Function

    The you can add/remove columns, move the columns around to summarize differently, etc.

  5. #5
    Registered User
    Join Date
    06-29-2010
    Location
    Central Texas
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: Sum Mutliple criteria Using the mid Function

    If I am following, using a sumproduct for each disc
    to remove the 888 entries use
    SUMPRODUCT(--(MID(A2:A456,4,3)<>"888"),--(B2:B456="CE"),D2:D456)

    to get just the 888 for each disc use
    SUMPRODUCT(--(MID(A2:A456,4,3)="888"),--(B2:B456="CE"),D2:D456)

    Both these are for the Bill Amount for Disc "CE"
    Harley2

    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)

  6. #6
    Registered User
    Join Date
    01-29-2008
    Posts
    68

    Re: Sum Mutliple criteria Using the mid Function

    Quote Originally Posted by ChemistB View Post
    Okay, what defines a discipline? Once we figure that out, then you want all hours or dollars (which is it? both?) summed for that discipline unless the cost code contains 888 as the 4-6 characters?

    The Discipline are in column B, pick one as an example. As far as hours or dollars it doesn't matter, pick one and I'll figure out the other. I'm mostly concerned about the syntax of the formula.

  7. #7
    Registered User
    Join Date
    01-29-2008
    Posts
    68

    Re: Sum Mutliple criteria Using the mid Function

    Quote Originally Posted by Harley2 View Post
    If I am following, using a sumproduct for each disc
    to remove the 888 entries use
    SUMPRODUCT(--(MID(A2:A456,4,3)<>"888"),--(B2:B456="CE"),D2:D456)

    to get just the 888 for each disc use
    SUMPRODUCT(--(MID(A2:A456,4,3)="888"),--(B2:B456="CE"),D2:D456)

    Both these are for the Bill Amount for Disc "CE"
    Thanks Harley this is what I was looking for.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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