+ Reply to Thread
Results 1 to 5 of 5

DAVERAGE With criteria within the formula

  1. #1
    Registered User
    Join Date
    09-17-2013
    Location
    Wales
    MS-Off Ver
    Excel 2007
    Posts
    10

    Question DAVERAGE With criteria within the formula

    Morning All,

    I have a table of receipts monitoring fuel bought for a fleet of vehicles i would like another table to run a average fuel cost of the month. The DAVERAGE function seems to do what i need it to do, but the problem I have is that the criteria has to be set in cells, rather than in the formula itself. Is it possible to put the cirtiera directly into the Formula rather than have a table listed somewhere on the spreadsheet?

    Thanks in advance for the help

  2. #2
    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
    30,824

    Re: DAVERAGE With criteria within the formula

    Perhaps AVERAGEIFS as an alternative?

  3. #3
    Registered User
    Join Date
    09-17-2013
    Location
    Wales
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: DAVERAGE With criteria within the formula

    Thanks John for the quick reply,

    That looks like it could work, im using a formula something like his "=AVERAGEIFS(G2:G6,F2:F6,">=01/01/2016",F2:F6,"<=31/01/2016")" , off course this has one tiny problem is that it wouldn't account for a leap year in. Would you know how i could get around this fact? is there a way i can simplify it to simply look for month, rather than a date range?

    Regards
    Michael

  4. #4
    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
    30,824

    Re: DAVERAGE With criteria within the formula

    Not sure I understand about leap year.

    You have this "flexibility" ...

    =AVERAGEIFS(G2:G6,F2:F6,">=" &B1,F2:F6,"<="&EOMONTH(B1,0))

    B1= Date e.g 01/01/2016 so you could have dates (months) as column headings (01/01/2016, 01/02/2016 etc) formatted as "mmm-yy" for example

    Does this help?

  5. #5
    Registered User
    Join Date
    09-17-2013
    Location
    Wales
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: DAVERAGE With criteria within the formula

    Thanks again.

    the problem with the leap year was the extra day in February. but using EOMONTH has fixed that.

    Thanks
    Michael

+ 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. [SOLVED] Ignoring errors in DAVERAGE formula
    By Lharbicht in forum Excel General
    Replies: 11
    Last Post: 06-10-2014, 06:57 PM
  2. DAVERAGE help needed
    By andresd87 in forum Excel General
    Replies: 9
    Last Post: 07-17-2011, 02:29 PM
  3. DAVERAGE criteria HELP!!!!
    By farmedgirl in forum Excel General
    Replies: 2
    Last Post: 04-23-2006, 08:10 AM
  4. Daverage
    By nir020 in forum Excel General
    Replies: 9
    Last Post: 11-01-2005, 04:09 PM
  5. How do I use DAverage in Excel?
    By Roger Govier in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-06-2005, 06:05 PM
  6. How do I use DAverage in Excel?
    By xrayr in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  7. How do I use DAverage in Excel?
    By Roger Govier in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 06:05 AM

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