+ Reply to Thread
Results 1 to 22 of 22

AVERAGEIFS can you use it with an or.

  1. #1
    Registered User
    Join Date
    08-28-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    26

    AVERAGEIFS can you use it with an or.

    Hi,

    I am trying to automate a tedious excel process, I want to be able to Average rates dependant on a number of criterias but instead of criteria 1 and criteria 2 ... I want it to average if teh data is criteria 1 OR criteria 2 etc.

    I have attached the excel spreadsheet I am working from.

    Many thanks,

    Will
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: AVERAGEIFS can you use it with an or.

    Are you just looking for the average rate for the e.g. Tarmac entries on sheet 2? If so, this should work - enter in H17 on sheet1 and fill left:

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


    If not, can you clarify the end result of what you're looking for? What value should you get in F17:H17?

  3. #3
    Registered User
    Join Date
    08-28-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: AVERAGEIFS can you use it with an or.

    I am after the average of all the rates for that week for each different material. So in F17 I should get 25.55555, G17 26.25 and H17 20. Once I get the average rate for each material for the whole week I can multiply it by the total volume and work out what I have spent.

    Hope thats clear,

    Cheers.

  4. #4
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: AVERAGEIFS can you use it with an or.

    Does the formula I posted not work? For me, it returns Concrete: 25.55555, Hardcore: 20, and Tarmac: 26.25...

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: AVERAGEIFS can you use it with an or.

    Hi,

    F17 copied across

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


    I think there's a typo in your example. You have G17 & H17 swapped over.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: AVERAGEIFS can you use it with an or.

    Quote Originally Posted by cantosh View Post
    Does the formula I posted not work? For me, it returns Concrete: 25.55555, Hardcore: 20, and Tarmac: 26.25...
    ...I'm assuming the sheet 2 is a special case and in reality there will be many dates which straddle many weeks/months. Maybe Vokey9 will comment.

  7. #7
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: AVERAGEIFS can you use it with an or.

    True.

    Vokey9, Richard's formula performs and additional date check that mine doesn't. If the date ranges on sheets one and two aren't going to match all the time, then definitely use his formula. If the dates will always match, then either formula should give you the same results.

  8. #8
    Registered User
    Join Date
    08-28-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: AVERAGEIFS can you use it with an or.

    Hi Yes richard is right I have included an updated version which I think makes it clearer. There are multiple dates with multiple material delivered.

    See attached.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: AVERAGEIFS can you use it with an or.

    @Vokey9

    I believe it would be more appropriate to post the value that must obtain in F17 instead of a non-working formula...

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: AVERAGEIFS can you use it with an or.

    Hi,

    Why did you not use the formula I gave you? You're still not building in the date criteria and appear to have ignored my suggestion.

    However I think there's a more fundamental potential error. Are you sure you want a simple average of the rates?

    In this trivial example it won't be a problem since all the volumes are exactly the same whereas in reality they will almost certainly vary. In which case and statistically speaking a simple average of rates would be incorrect. You should be using a weighted average by building in the volume.

  11. #11
    Registered User
    Join Date
    08-28-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: AVERAGEIFS can you use it with an or.

    Richard sorry I have used yoru formula I reposted before I checked and was too busy celebrating to post. The formula is perfect, I have fed into my larger spreadsheet and it works a treat. The only issue I am having is When there is no data it is returning a DIV/0 error. This messes up other formula that I have going. Is there away to get it to return just a blank cell instead of DIV/0 error??

  12. #12
    Registered User
    Join Date
    08-28-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: AVERAGEIFS can you use it with an or.

    That is a very good point, the lorries we use are standard and I have never seen a different truck. I will ask my manager whether we use different sized trucks and get back to you. Thansk for flagging that.

  13. #13
    Registered User
    Join Date
    08-28-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: AVERAGEIFS can you use it with an or.

    I've solved the IFFError thing, Richard you are a genius. Many thanks!

  14. #14
    Registered User
    Join Date
    08-28-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: AVERAGEIFS can you use it with an or.

    I have just found out that every now and then we use a 9m3 lorry. How would I go about using a weighted average to make the tool comprehensive?

  15. #15
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: AVERAGEIFS can you use it with an or.

    Hi,

    This would therefore be a better formula in F17. Adjust the 1000 row range as necessary to cover the maximum range - or create dynamic range names that automatically adjust.

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

  16. #16
    Registered User
    Join Date
    08-28-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: AVERAGEIFS can you use it with an or.

    Just for my own peace of mind cabn you just explain to me why I dont need to reference the dates I want to extract data for?? I cant figure out how it works!!

  17. #17
    Registered User
    Join Date
    08-28-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: AVERAGEIFS can you use it with an or.

    I have just put the forumula in to my spreadsheet and realised that unfortunately I am getting an average rate for all dates, I want to only get an average for the dates in teh table in sheet 1. I feel like I need a SUMPRODUCTSIF function but that doesnt exist!

    Is there anyway of combining the first and second equation that Richard gave me??

  18. #18
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: AVERAGEIFS can you use it with an or.

    Hi,

    Sorry, forgot to add the date criteria to the SUMPRODUCT and SUMIFS parts

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by Richard Buttrey; 02-26-2016 at 11:17 AM.

  19. #19
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: AVERAGEIFS can you use it with an or.

    ...
    And another method if you were to add a helper column Q to sheet 2, i.e.
    Q6
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then on sheet1 in F17

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

  20. #20
    Registered User
    Join Date
    08-28-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: AVERAGEIFS can you use it with an or.

    Does the last equation incorperate the dates?? If so I will try using that,for some reason I cant translate across teh original forumal to my master copy I keep getting massive numbers as a rate!

  21. #21
    Registered User
    Join Date
    08-28-2013
    Location
    Bristol
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: AVERAGEIFS can you use it with an or.

    My head is fried I cant begin to work out how to incorperate the dates, I realise it will be similar to above but i dont fully understand it!?

  22. #22
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: AVERAGEIFS can you use it with an or.

    Hi,

    Sorry the date criteria were missing from the formula in post #19.

    The general layout of SUMIFS() functions are
    SUMIFS(RangeToSum,1stCriteriaRange,1stCriteria,2ndCriteriaRange,2ndCriteria......nthCriteriaRange,nthCriteria

    Hence you'll need two new pairs of criteria, one each for the start and end dates of the week in each of the SUMIFS

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

+ 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. Averageifs
    By Tim Bos in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-26-2015, 09:41 AM
  2. [SOLVED] Averageifs
    By yuenk in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-07-2015, 10:59 AM
  3. [SOLVED] Averageifs
    By nd4spd in forum Excel General
    Replies: 7
    Last Post: 07-04-2014, 05:33 AM
  4. [SOLVED] Averageifs
    By mahershams in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-23-2014, 08:40 AM
  5. [SOLVED] averageifs help!
    By tgosman in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-30-2013, 09:34 PM
  6. [SOLVED] AverageIfs, Max and Min
    By Odie2012 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-11-2012, 07:57 PM
  7. AverageIfs
    By DMAN11 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-07-2010, 05:31 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