+ Reply to Thread
Results 1 to 14 of 14

Calculate Best and Worst average

  1. #1
    Forum Contributor
    Join Date
    02-15-2012
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2019
    Posts
    431

    Calculate Best and Worst average

    Hi,

    Need to calculate Best and Worst average job from the list.

    An excel file attached with necessary details.

    Pl. help.

    Thanks,
    Nagesh.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Calculate Best and Worst average

    ---Deleted---
    Last edited by Limor_OP; 04-10-2021 at 02:24 PM.

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Calculate Best and Worst average

    Please try at
    F4,F7

    =MAX(AVERAGEIFS(B3:B55,B3:B55,">0",A3:A55,A3:A55))

    =MIN(AVERAGEIFS(B3:B55,B3:B55,">0",A3:A55,A3:A55))

    E4,E7

    =INDEX(A3:A55,MATCH(F4,AVERAGEIFS(B3:B55,B3:B55,">0",A3:A55,A3:A55),))

    =INDEX(A3:A55,MATCH(F7,AVERAGEIFS(B3:B55,B3:B55,">0",A3:A55,A3:A55),))
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    02-15-2012
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2019
    Posts
    431

    Re: Calculate Best and Worst average

    Hi Bo_Ry,
    Its working well. But i forgot to indicate two things.
    1. The formula should exclude the Job No. begins with "HY-00" and "HY-8".
    2. There will be some more exclusions with no logic, which the user only can decide. Formula to consider the exclusions which will be indicated by user as "E" in Col.C.

    Grateful if you can help on this.

    Thanks,
    Nagesh.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Calculate Best and Worst average

    If you have 'forgotten' anything else, please declare it now before anyone spends more time on your request.

    The second request should be easy to do by adding another criterion to the AVERAGEIFS, e.g.

    =MAX(AVERAGEIFS(B3:B55,B3:B55,">0",A3:A55,A3:A55,C3:C55,"<>E"))

    Give it a try.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Calculate Best and Worst average

    Add exclusion in C3:C6
    Please try at
    F4,F7


    =AGGREGATE(14,6,AVERAGEIFS(B3:B55,B3:B55,">0",A3:A55,A3:A55,A3:A55,"<>"&IF(C3="","",C3&"*"),A3:A55,"<>"&IF(C4="","",C4&"*"),A3:A55,"<>"&IF(C5="","",C5&"*"),A3:A55,"<>"&IF(C6="","",C6&"*")),1)

    =AGGREGATE(15,6,AVERAGEIFS(B3:B55,B3:B55,">0",A3:A55,A3:A55,A3:A55,"<>"&IF(C3="","",C3&"*"),A3:A55,"<>"&IF(C4="","",C4&"*"),A3:A55,"<>"&IF(C5="","",C5&"*"),A3:A55,"<>"&IF(C6="","",C6&"*")),1)


    E4,E7
    =INDEX(A3:A55,MATCH(F4,AVERAGEIFS(B3:B55,B3:B55,">0",A3:A55,A3:A55,A3:A55,"<>"&IF(C3="","",C3&"*"),A3:A55,"<>"&IF(C4="","",C4&"*"),A3:A55,"<>"&IF(C5="","",C5&"*"),A3:A55,"<>"&IF(C6="","",C6&"*")),))

    =INDEX(A3:A55,MATCH(F7,AVERAGEIFS(B3:B55,B3:B55,">0",A3:A55,A3:A55,A3:A55,"<>"&IF(C3="","",C3&"*"),A3:A55,"<>"&IF(C4="","",C4&"*"),A3:A55,"<>"&IF(C5="","",C5&"*"),A3:A55,"<>"&IF(C6="","",C6&"*")),))
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    02-15-2012
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2019
    Posts
    431

    Re: Calculate Best and Worst average

    I am sorry for that Ms. Ali. Will take care in future.

    Your solution is working for my second request.

    Grateful if i get solution for my first request too.

    Thanks,
    Nagesh.

  8. #8
    Forum Contributor
    Join Date
    02-15-2012
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2019
    Posts
    431

    Re: Calculate Best and Worst average

    Almost ok but I think i could not covney what i wanted with regard to C5 formula. The exclusion should be applicable to the entire column (C3:C55). Ex: Worst Avg. is 820 Kg. but i want it to be excluded (I will put "E" in col. C of respective cell) so that the formula should consider next worst avg. i.e. 4860 Kg. (HY-06192).

    HY-00 & HY-8 can be inside the formula, since the above formula covers C3:C55.

    Hope i could convey what i wanted.

    Pl. help.

    Nagesh.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Calculate Best and Worst average

    Administrative Note:

    We don't expect you to bump threads sooner than 24 hours after your last post or more than once a day - it has been only an hour and 10 minutes since you last posted. Please remember that those who help here do so voluntarily and of their own goodwill. They live in many different time zones and many will be out at work right now if they are not asleep on the other side of the globe. This is not a paid 'service': members will help when they are ready and able to do so, and not 'on demand'. Please do not try to put pressure of time on anyone here: if you get the help you need today, that's fine, but you really should not count on it. Thanks for your understanding and patience.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Calculate Best and Worst average

    HY-08 and HY-00 are put in cells because AVERAGEIFS does not allow the use of functions such as LEFT which would typically be used.

    Cut/Paste table in C to Column D

    Formula in G4 of Attached

    =AGGREGATE(14,6,AVERAGEIFS(B3:B55,B3:B55,">0",C3:C55,"<>E",A3:A55,A3:A55,A3:A55,"<>"&IF(D3="","",D3&"*"),A3:A55,"<>"&IF(D4="","",D4&"*"),A3:A55,"<>"&IF(D5="","",D5&"*"),A3:A55,"<>"&IF(D6="","",D6&"*")),1)

    in G7

    =AGGREGATE(15,6,AVERAGEIFS(B3:B55,B3:B55,">0",C3:C55,"<>E",A3:A55,A3:A55,A3:A55,"<>"&IF(D3="","",D3&"*"),A3:A55,"<>"&IF(D4="","",D4&"*"),A3:A55,"<>"&IF(D5="","",D5&"*"),A3:A55,"<>"&IF(D6="","",D6&"*")),1)
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    02-15-2012
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2019
    Posts
    431

    Re: Calculate Best and Worst average

    Hi John Topley,

    Your formula working fine at G4 & G7, but shows #N/A in F4. Ex: HY-05840 appears in 3 places and and when i put "E" in one of the cells in Col. C, the answer is working fine in G4 but F4 shows #N/A, but it should show HY-05840.

    Thanks,
    Nagesh.

  12. #12
    Forum Contributor
    Join Date
    02-15-2012
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2019
    Posts
    431

    Re: Calculate Best and Worst average

    Ms. Ali, My apologies for that.

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Calculate Best and Worst average

    I works fine for me as you will see from the file I posted: did you enter the formulae with Ctrl+Shift+Enter?

  14. #14
    Forum Contributor
    Join Date
    02-15-2012
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2019
    Posts
    431

    Re: Calculate Best and Worst average

    I incorporated C3:C55,"<>E" in F4 and now its working perfectly.

    Thank you so much. You made my day.

    Thank you once again John Topley, Bo_Ry, Ali for your time and effort.

+ 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. Replies: 5
    Last Post: 09-11-2018, 10:29 AM
  2. Worst Forum Day Ever
    By ChemistB in forum The Water Cooler
    Replies: 9
    Last Post: 03-10-2016, 04:58 AM
  3. Worst Practices
    By GeneralDisarray in forum The Water Cooler
    Replies: 1
    Last Post: 08-28-2015, 04:06 PM
  4. [SOLVED] consider only the 3 worst stocks?
    By eac13 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-04-2015, 07:54 PM
  5. [SOLVED] Use the AVERAGE() function to calculate a sample average
    By alice2011 in forum Excel General
    Replies: 1
    Last Post: 09-24-2014, 08:04 AM
  6. best and worst outcomes
    By xela1986 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-24-2006, 06:27 PM
  7. [SOLVED] The worst Code Ever
    By Jacob_F_Roecker in forum Excel General
    Replies: 4
    Last Post: 03-12-2006, 07:55 PM

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