+ Reply to Thread
Results 1 to 13 of 13

Sum Specific Line in Job Based on another Condition

  1. #1
    Registered User
    Join Date
    04-24-2012
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    34

    Sum Specific Line in Job Based on another Condition

    Hi,

    I've got some code data that I'm trying to summarize. Basically I have a list of Jobs (Work Orders). I want to add all the $'s assigned to the JC679 code in my list of jobs, but ONLY IF the job (work order) also contains a JC304 code.

    This will help me greatly to break out costs on my invoicing. Thanks so much!

    WO_Example.jpg

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Sum Specific Line in Job Based on another Condition

    Hello
    Perhaps something like:

    Please Login or Register  to view this content.
    This is for the cells with the 12345 Work Order and copy down for the others.

    DBY

  3. #3
    Registered User
    Join Date
    04-24-2012
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Sum Specific Line in Job Based on another Condition

    Quote Originally Posted by DBY View Post
    Hello
    Perhaps something like:

    Please Login or Register  to view this content.
    This is for the cells with the 12345 Work Order and copy down for the others.

    DBY
    No, unfortunately that didn't work. To use that formula, I would have to change the range for each work order. It doesn't build a criteria that excludes the calculation if the work order doesn't have a JC304 specifically on it. I need one formula that I can bring down over thousands of work orders / lines. Thanks for the suggestion though.

    Anyone else?

  4. #4
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Sum Specific Line in Job Based on another Condition

    Hi
    Sorry it didn't work. Are the Work Orders always in groups of three as in your example?

    *Just noticed the last one is two so I've answered my own question. I'll see if I can amend the formula.
    Last edited by DBY; 04-27-2015 at 11:32 AM. Reason: added note*

  5. #5
    Registered User
    Join Date
    04-24-2012
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Sum Specific Line in Job Based on another Condition

    Yeah, there can be any combination of lines for a given work order. It's a tough one

  6. #6
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Sum Specific Line in Job Based on another Condition

    Hello
    If your actual data layout is the same as your example and is consistent, perhaps you could create a unique list of the Work Orders using Advanced Filter and build a totals table for each Order. You could then use Vlookup to reference this table if you wished to drag down the formulas alongside your data.

    See the attached example. Hope this is of some help.
    DBY
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    04-24-2012
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Sum Specific Line in Job Based on another Condition

    Thanks. I can certainly give that a try. A few extra steps (I was hoping for a one step formula), but it does seem to work. Thanks again for all the help with this one!

  8. #8
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Sum Specific Line in Job Based on another Condition

    Glad it's useful, if I can come up with a one step formula I'll get back, but I'm finding it tricky.

  9. #9
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Sum Specific Line in Job Based on another Condition

    If you're still looking for a single formula to total each Work Order as above, then try the following in cell D2 down in the example file I posted:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Be aware of the various absolute Row references for this to work.
    DBY

  10. #10
    Registered User
    Join Date
    04-24-2012
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Sum Specific Line in Job Based on another Condition

    Quote Originally Posted by DBY View Post
    If you're still looking for a single formula to total each Work Order as above, then try the following in cell D2 down in the example file I posted:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Be aware of the various absolute Row references for this to work.
    DBY
    Oh WOW! That did the trick! I appreciate you sticking with this one. Well done. I never would've figured it out.

    Thanks again,

    Rob

  11. #11
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Sum Specific Line in Job Based on another Condition

    Here is a solution that includes a helper column to make the calculation simple. The helper column will have YES if JC304 is included in the Work Order.

    The formula to sum JC679 will only do the sum if the Work Order contains a YES in the helper column.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  12. #12
    Registered User
    Join Date
    04-24-2012
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: Sum Specific Line in Job Based on another Condition

    Yep, that one works too. Having the helper column just makes it easier for my tired mind to understand, and the overall concept is the same.

    Thanks so much!

  13. #13
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Sum Specific Line in Job Based on another Condition

    Sometimes helper columns make things much easier to understand and execute.

    Thank you for the feedback.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. sum multiple columns based on specific condition
    By chiwing in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-03-2014, 11:38 AM
  2. Sumproduct Formula Based on Specific Condition
    By arlapin in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-05-2012, 06:56 PM
  3. Remove rows based on specific condition
    By shinichi_nguyen in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2012, 02:30 PM
  4. selecting specific rows based on condition
    By darkhorse4321 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-03-2010, 02:02 AM
  5. Highlight the cell based on the specific condition
    By shaan65 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-25-2010, 02:07 AM

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