+ Reply to Thread
Results 1 to 19 of 19

Return Top Criteria Based on Sum of Hours

  1. #1
    Registered User
    Join Date
    07-06-2016
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    46

    Return Top Criteria Based on Sum of Hours

    Hi

    I want to return the job with the highest (and second highest) sum of hours by machine from the INPUT tab and also return the sum of those hours in the cell below. For example for the Cat - Grader - 140 machine, the top job so far this year was R&M - Roads with 36 hours, while the second highest for this machine was CAPEX with 22 hours

    Info below

    Hours sum range = INPUT!$J$3:$J$300
    Job range = INPUT!$E$3:$E$300
    Machine criteria range = INPUT!$D$3:$D$300
    Machine = SUMMARY!D$2


    The results should return to SUMMARY!D4, SUMMARY!D5 (for the top ranked job and sum of hours), SUMMARY!D6, SUMMARY!D7 (for the second highest ranked job and sum of hours)

    Thanks in advance

    Mike

  2. #2
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Return Top Criteria Based on Sum of Hours

    Try in "D5"
    Formula: copy to clipboard
    Please Login or Register  to view this content.

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


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  3. #3
    Registered User
    Join Date
    07-06-2016
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    46

    Re: Return Top Criteria Based on Sum of Hours

    Hi, appreciate your help but its the formula in D4 and D6 that i am after

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Return Top Criteria Based on Sum of Hours

    Give this try in

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


    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    Copy across.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Return Top Criteria Based on Sum of Hours

    please enter require result in respective cell.

  6. #6
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Return Top Criteria Based on Sum of Hours

    AVK OP asked D4 to F7 result by formula

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Return Top Criteria Based on Sum of Hours

    Quote Originally Posted by Manwithaplan View Post
    Hi, appreciate your help but its the formula in D4 and D6 that i am after
    In D4 array enter this formula. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In D6 array enter this.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Return Top Criteria Based on Sum of Hours

    If still need hours array enter this in D5
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and in D7
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Return Top Criteria Based on Sum of Hours

    @Dave if you do apply your formula the cell reference counter each other and circular reference error would show !!

  10. #10
    Registered User
    Join Date
    07-06-2016
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    46

    Re: Return Top Criteria Based on Sum of Hours

    Thanks FlameRetired, this works well. I do however try to avoid array formulas where possible. Is there any other way to do this that doesnt require an array formula?

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Return Top Criteria Based on Sum of Hours

    Quote Originally Posted by shukla.ankur281190 View Post
    @Dave if you do apply your formula the cell reference counter each other and circular reference error would show !!
    Yes. I noticed that later. I jumped into the middle of the thread assuming the hours were already solved. My bad.

  12. #12
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Return Top Criteria Based on Sum of Hours

    Quote Originally Posted by Manwithaplan View Post
    Thanks FlameRetired, this works well. I do however try to avoid array formulas where possible. Is there any other way to do this that doesnt require an array formula?
    I'll look into that. Right now it is way past my bed time.

  13. #13
    Registered User
    Join Date
    07-06-2016
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    46

    Re: Return Top Criteria Based on Sum of Hours

    No problem, thanks for your help. Look forward to see what you come up with

  14. #14
    Registered User
    Join Date
    07-06-2016
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    46

    Re: Return Top Criteria Based on Sum of Hours

    See D4 to D7

  15. #15
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Return Top Criteria Based on Sum of Hours

    When you say you want to avoid array formulas is the issue Ctrl + Shift + Enter, or is it something else? There are array formulas that don't require that. In either event this may require some helper columns. Are you open to this?

  16. #16
    Registered User
    Join Date
    07-06-2016
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    46

    Re: Return Top Criteria Based on Sum of Hours

    Quote Originally Posted by FlameRetired View Post
    When you say you want to avoid array formulas is the issue Ctrl + Shift + Enter, or is it something else? There are array formulas that don't require that. In either event this may require some helper columns. Are you open to this?
    A bit of the ctr shift enter (for other users) and they also tend to be heavier in calculation. I am open to helper columns

  17. #17
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Return Top Criteria Based on Sum of Hours

    Good deal.

    None of these are array formula.

    In 'INPUT' sheet cell N1 is today's date.

    In N3 and filled down returns the row number of the first occurrences (and therefore unique) instances of Work Types. These will be the index numbers for the Work Type headers helper columns.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The Work Type headers output with this formula in P2 and filled across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The first occurrence (unique) of each Machine returns with this in O3 and filled down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then the hour summaries return with this in P3 filled down and across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    On 'SUMMARY' sheet this for the 1st place Work Type by Machine. In D4 and filled across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Copy that range D4:F4 and paste to D6 to return 2nd place.

    For the most hours this in D5 and across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Copy D5:F5 and paste to D7 to return 2nd most hours.

  18. #18
    Registered User
    Join Date
    07-06-2016
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    46

    Re: Return Top Criteria Based on Sum of Hours

    Cheers Ill give it a go thanks heaps for your help.

    You might also know the answer to this post which i thought would be an easy fix but has been dragging on a bit
    https://www.excelforum.com/excel-for...nk-values.html

  19. #19
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Return Top Criteria Based on Sum of Hours

    You are welcome. I'll have a look at the other thread as time permits.

+ 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. Adding Hours Worked on Employee Schedule based on varying daily criteria
    By CGF2704 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-07-2016, 11:19 AM
  2. Replies: 1
    Last Post: 06-03-2014, 06:28 PM
  3. Copy cell value based on 2 other criteria. Ive searched and tried for hours
    By rubidriver in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-16-2014, 02:58 AM
  4. [SOLVED] Return number of hours per month based on start and end dates
    By sparky1231 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-29-2014, 12:33 PM
  5. [SOLVED] Calculating Hours Based On 3 Criteria
    By Gtrtim112 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-10-2013, 04:06 PM
  6. [SOLVED] Summing overtime hours based on multiple criteria
    By nickmessick1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-11-2013, 01:53 PM
  7. Return value based off 2 criteria.
    By iamdavid in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-11-2010, 05:37 PM

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