Forum Discussion

Michael1105's avatar
Michael1105
Brass Contributor
Nov 19, 2020
Solved

Need Help on stopping the #DIV/0! error.

I am at my wits end.  I have been trying to get this to work for hours.  

What I need is to have cell I15 evaluate cell H15.  

If H15 has a value equal to or greater than 0.00 then to calculate the average of H15 otherwise leave leave I15 BLANK or 0.

Then I need to have cell I16 evaluate cells H15 and H16.

If H15 and/or H16 has/have a value equal to or greater than 0.00 then to calculate the average of H15 and H16, otherwise leave leave I16 BLANK or 0.

And so one through cell I26...keeping in mind that cells H15 thru H25 could possibly have a value of BLANK due to the data populated to these cells.

 

I have figured out how to do the averaging of these cells...my issue is that I cannot figure out how to get rid of the #DIV/0! error result in the cells I15, etc, when the value in H15, etc is BLANK.

 

The reason for these cells having a value of BLANK is because the workbook I created is to track teller differences and set scoring for annual performance reviews.  I can't have the worksheet average into the calculation the months the individual was not employed.  This will skew the person's average at the end of the year resulting in an incorrect performance score.

 

 

See the attachment for the formula being used in each cell.

 

I would appreciate any assistance anyone can lend with this.  

 

9 Replies

    • Michael1105's avatar
      Michael1105
      Brass Contributor

      Ilgar_Zarbaliyev Thank you very much.  The second suggestion is exactly what I needed to fix the error.  The first wouldn't have worked with the results I needed because the monthly average that would result in a "blank" I cannot have averaged into the YTD Rolling Average.  The second takes into account that the Blank would not be counted into the calculation, and still clears the error.  

       

      I appreciate your assistance with this.  You are a lifesaver!

  • Michael1105 

    Your tests are based upon the AVERAGE to date but you should not be testing against 0, you should be testing for an error using ISERROR or ISNUMBER.  Better, base the test on the COUNT

    = IF( COUNT(ValuesToDate), AVERAGE(ValuesToDate), "" )

    • Michael1105's avatar
      Michael1105
      Brass Contributor
      I appreciate your help and time in responding. I appreciate it very much 🙂
  • adversi's avatar
    adversi
    Iron Contributor

    Michael1105 

    You will need to apply an IFERROR function to the start of your formula. 

    Although the IF statement is correct, excel registers the BLANK as "" and not as an integer, which is why the >=0 returns an error.

    You're adjusted formula would be

     

    =IFERROR(IF(AVERAGE(....""),)

     

    • Michael1105's avatar
      Michael1105
      Brass Contributor
      I appreciate your help and response. Thank you very much 🙂

Resources