+ Reply to Thread
Results 1 to 12 of 12

AverageIf by excluding zeros?

  1. #1
    Registered User
    Join Date
    07-17-2012
    Location
    Latvia
    MS-Off Ver
    Excel 2010
    Posts
    12

    AverageIf by excluding zeros?

    Hi guys,

    I really need your help.

    I am stuck in a development on a comparison tool for sales. I have to average Actual Sales from last couple of monts on a specific day. For example I have dont have sales report for May and April sales on working day 8, but I have for june. When averaging sales, it devides june sales by 3, but I should exclude zeros and devide it by 1.

    For working day 5 i would have sales for all previous month, so deleting formulas from April and May table would not work.

    7-17-2012 12-19-23 PM.png

    Values for montly tables are taken from database with formula - =SUMIF(DATABASE!$E:$E,Sales!C$3&Sales!$A$14&Sales!$J$1,DATABASE!$K:$K)
    Average is calculated with formula - =AVERAGEIF($B$14:$B$47,$B$9,C$14:C$47)

    Could you please advise me on how to make average work by excluding zero values in this case?

    Thank you guys a lot!

    Regards,
    Artis89
    Last edited by Artis89; 07-17-2012 at 05:32 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: AverageIf by excluding zeros?

    Try:

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

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: AverageIf by excluding zeros?

    Hi

    Try


    =AVERAGEIFs(C$14:C$47,$B$14:$B$47,$B$9,C$14:C$47,">0")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    07-17-2012
    Location
    Latvia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: AverageIf by excluding zeros?

    Guys, thank you for replies!

    Fotis, your suggestion works perfecty! Thanks man and I appreciate the quick response! One question - could you advise me on how to get rid of #div/0! for those months where there are no sales at all? I have to report one new departement and dont have any info for that yet. I am using your formula. Thanks!

    Regards,
    Artis89
    Last edited by Artis89; 07-17-2012 at 06:53 AM.

  5. #5
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: AverageIf by excluding zeros?

    Use

    =iferror(AVERAGEIFs(C$14:C$47,$B$14:$B$47,$B$9,C$14:C$47,">0"),"")
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: AverageIf by excluding zeros?

    Hi

    You are welcome.

    Try with iferror.

    =IFERROR(AVERAGEIFs(C$14:C$47,$B$14:$B$47,$B$9,C$14:C$47,">0"),"")

  7. #7
    Registered User
    Join Date
    07-17-2012
    Location
    Latvia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: AverageIf by excluding zeros?

    You are awesome guys! The best forum with the quickest responses!

    Thank you so much! Thanks to you, now I can finish my report template!

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: AverageIf by excluding zeros?

    Yes, Fotis solution works. sorry, when copy-pasting forgot to chaneg criteria.

  9. #9
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: AverageIf by excluding zeros?

    @Artis89
    Welcome to the forum. Based on your last post I'll mark your thread as SOLVED. Please remember to do that yourself for your future threads. Thanks.

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: AverageIf by excluding zeros?

    Nice idea, Cutter!

    Congr!

  11. #11
    Registered User
    Join Date
    07-17-2012
    Location
    Latvia
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: AverageIf by excluding zeros?

    Cutter,

    I am very new to this forum, but future threads Ill do as you suggested.

    Thanks!
    Artis89

  12. #12
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: AverageIf by excluding zeros?

    Thanks Artis89. Enjoy your membership!

    And, thank you, too, Fotis.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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