+ Reply to Thread
Results 1 to 10 of 10

Average formula that starts at first cell>0 and calculates blank cells as 0?

  1. #1
    Registered User
    Join Date
    08-22-2012
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2007
    Posts
    5

    Post Average formula that starts at first cell>0 and calculates blank cells as 0?

    Basically, I’m trying to combine this formula that captures the first value above zero, but ignores blank cells:

    IF(MAX($B5:$M5),AVERAGE(INDEX($B5:$M5,MATCH(TRUE,INDEX($B5:$M5>0,0),0)):$M5),"")

    With this array formula that counts blank cells as zeroes:

    {=AVERAGE(IF(B5:M5,B5:M5,B5:M5))}

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Average formula that starts at first cell>0 and calculates blank cells as 0?

    Have you tried AVERAGEA ? if does ignores blank or text cells

  3. #3
    Registered User
    Join Date
    08-22-2012
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Average formula that starts at first cell>0 and calculates blank cells as 0?

    I want to include blank cells as zero values. I don't think AVERAGEA works in this case.

  4. #4
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Average formula that starts at first cell>0 and calculates blank cells as 0?

    Quote Originally Posted by bradtredo View Post
    I’m trying to combine this formula that captures the first value above zero, but ignores blank cells
    Quote Originally Posted by bradtredo View Post
    I want to include blank cells as zero values.

    Do you want to IGNORE blank cells, or do you want to INCLUDE them?
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

  5. #5
    Registered User
    Join Date
    08-22-2012
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Average formula that starts at first cell>0 and calculates blank cells as 0?

    I need to take the aspect of the second formula that recognizes blank cells as zero and incorporate it into the first formula. Ultimately, I want to have an average of the cells after the first value > 0 that includes blank cells as 0 in the average.

  6. #6
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Average formula that starts at first cell>0 and calculates blank cells as 0?

    Lets Take a structured approach to this

    First determine which row contains the first cell >0 -> Beg Cell
    Then determine how many rows are "used" -> Ending Cell

    =Average(INDIRECT(Beg Cell&":"&Ending Cell))

  7. #7
    Registered User
    Join Date
    08-22-2012
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Average formula that starts at first cell>0 and calculates blank cells as 0?

    RCM, that was the way to go. Here's what I came up with:

    =SUM(B5:M5)/(12-(MATCH(TRUE,LEN(B5:M5)<>0,0)))

    Thanks so much for your help. I think I was making this way too complicated.

  8. #8
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Average formula that starts at first cell>0 and calculates blank cells as 0?

    The following array formula applied to range A1:A9 as an example does the trick
    Please Login or Register  to view this content.
    The first non zero value is found with
    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Average formula that starts at first cell>0 and calculates blank cells as 0?

    glad I could help Bradtredo, Happier Holydays !!!! (now that you solved your inquiry)

  10. #10
    Registered User
    Join Date
    08-22-2012
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Average formula that starts at first cell>0 and calculates blank cells as 0?

    Deleted the last post. The correct formula is:

    =IFERROR((SUM(B5:M5)/(13-(MATCH(TRUE,LEN(B5:M5)<>0,0)))),"")

    Also, it is an array, so use CTRL+SHIFT+ENTER
    Last edited by bradtredo; 12-20-2012 at 06:12 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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