SOLVED

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

%3CLINGO-SUB%20id%3D%22lingo-sub-1912994%22%20slang%3D%22en-US%22%3ENeed%20Help%20on%20stopping%20the%20%23DIV%2F0!%20error.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1912994%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20at%20my%20wits%20end.%26nbsp%3B%20I%20have%20been%20trying%20to%20get%20this%20to%20work%20for%20hours.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I%20need%20is%20to%20have%20cell%20%3CEM%3EI15%3C%2FEM%3E%26nbsp%3Bevaluate%20cell%20%3CEM%3EH15%3C%2FEM%3E.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20%3CEM%3EH15%3C%2FEM%3E%26nbsp%3Bhas%20a%20%3CEM%3Evalue%3C%2FEM%3E%20%3CU%3E%3CSTRONG%3Eequal%20to%20or%20greater%20than%3C%2FSTRONG%3E%3C%2FU%3E%20%3CEM%3E0.00%3C%2FEM%3E%20then%20to%20calculate%20the%20%3CSTRONG%3Eaverage%3C%2FSTRONG%3E%20of%20%3CEM%3EH15%26nbsp%3B%3C%2FEM%3Eotherwise%20leave%20leave%20%3CEM%3EI15%3C%2FEM%3E%26nbsp%3B%3CSTRONG%3E%3CEM%3EBLANK%3C%2FEM%3E%20%3C%2FSTRONG%3Eor%3CEM%3E%3CSTRONG%3E%200%3C%2FSTRONG%3E%3C%2FEM%3E.%3C%2FP%3E%3CP%3EThen%20I%20need%20to%20have%20cell%20%3CEM%3EI16%3C%2FEM%3E%26nbsp%3Bevaluate%20cells%20%3CEM%3EH15%3C%2FEM%3E%26nbsp%3Band%20%3CEM%3EH16%3C%2FEM%3E.%3C%2FP%3E%3CP%3EIf%20%3CEM%3EH15%3C%2FEM%3E%26nbsp%3Band%2For%20%3CEM%3EH16%3C%2FEM%3E%26nbsp%3Bhas%2Fhave%20a%20%3CU%3E%3CSTRONG%3Evalue%20equal%20to%20or%20greater%20than%3C%2FSTRONG%3E%3C%2FU%3E%20%3CEM%3E0.00%3C%2FEM%3E%20then%20to%20calculate%20the%20%3CSTRONG%3Eaverage%3C%2FSTRONG%3E%20of%20%3CEM%3EH15%3C%2FEM%3E%26nbsp%3Band%20%3CEM%3EH16%2C%26nbsp%3Botherwise%20leave%20leave%20I16%26nbsp%3B%3CSTRONG%3EBLANK%26nbsp%3B%3C%2FSTRONG%3E%3C%2FEM%3Eor%26nbsp%3B%3CSTRONG%3E%3CEM%3E0%3C%2FEM%3E.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EAnd%20so%20one%20through%20cell%20I26...keeping%20in%20mind%20that%20cells%20H15%20thru%20H25%20could%20possibly%20have%20a%20value%20of%20BLANK%20due%20to%20the%20data%20populated%20to%20these%20cells.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20figured%20out%20how%20to%20do%20the%20averaging%20of%20these%20cells...my%20issue%20is%20that%20I%20cannot%20figure%20out%20how%20to%20get%20rid%20of%20the%20%3CSTRONG%3E%23DIV%2F0%3C%2FSTRONG%3E!%20error%20result%20in%20the%20cells%20I15%2C%20etc%2C%20when%20the%20value%20in%20H15%2C%20etc%20is%20BLANK.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20reason%20for%20these%20cells%20having%20a%20value%20of%20BLANK%20is%20because%20the%20workbook%20I%20created%20is%20to%20track%20teller%20differences%20and%20set%20scoring%20for%20annual%20performance%20reviews.%26nbsp%3B%20I%20can't%20have%20the%20worksheet%20average%20into%20the%20calculation%20the%20months%20the%20individual%20was%20not%20employed.%26nbsp%3B%20This%20will%20skew%20the%20person's%20average%20at%20the%20end%20of%20the%20year%20resulting%20in%20an%20incorrect%20performance%20score.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESee%20the%20attachment%20for%20the%20formula%20being%20used%20in%20each%20cell.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20appreciate%20any%20assistance%20anyone%20can%20lend%20with%20this.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1912994%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1913073%22%20slang%3D%22en-US%22%3ERe%3A%20Need%20Help%20on%20stopping%20the%20%23DIV%2F0!%20error.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1913073%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F432860%22%20target%3D%22_blank%22%3E%40MichaelAntonelli%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20will%20need%20to%20apply%20an%20IFERROR%20function%20to%20start%20of%20your%20formula.%26nbsp%3B%3C%2FP%3E%3CP%3EAlthough%20the%20IF%20statement%20is%20correct%2C%20excel%20registers%20the%20BLANK%20as%20%22%22%20and%20not%20as%20an%20integer%2C%20which%20is%20why%20the%20%26gt%3B%3D0%20returns%20an%20error.%3C%2FP%3E%3CP%3EYou're%20adjusted%20formula%20would%20be%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DIFERROR(IF(AVERAGE(....%22%22)%2C)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1914153%22%20slang%3D%22en-US%22%3ERe%3A%20Need%20Help%20on%20stopping%20the%20%23DIV%2F0!%20error.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1914153%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F432860%22%20target%3D%22_blank%22%3E%40MichaelAntonelli%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYour%20tests%20are%20based%20upon%20the%20AVERAGE%20to%20date%20but%20you%20should%20not%20be%20testing%20against%200%2C%20you%20should%20be%20testing%20for%20an%20error%20using%20ISERROR%20or%20ISNUMBER.%26nbsp%3B%20Better%2C%20base%20the%20test%20on%20the%20COUNT%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3D%20IF(%20COUNT(ValuesToDate)%2C%20AVERAGE(ValuesToDate)%2C%20%22%22%20)%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1914219%22%20slang%3D%22en-US%22%3ERe%3A%20Need%20Help%20on%20stopping%20the%20%23DIV%2F0!%20error.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1914219%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F432860%22%20target%3D%22_blank%22%3E%40MichaelAntonelli%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20there%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20are%20two%20ways%20to%20solve%20this%20problem.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1%20-%20You%20must%20change%20blank%20cell%20into%200.%20%3D%26nbsp%3B%3DIF(AVERAGE(A2%26gt%3B%3D0)%2CAVERAGE(A2)%2C%20%22%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20this%20case%20your%20formula%20will%20work%20perfect.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2%20-%20If%20you%20don't%20want%20to%20change%2C%20then%20use%20Iferror%20function.%20-%26nbsp%3B%3DIFERROR(IF(AVERAGE(A2%26gt%3B%3D0)%2CAVERAGE(A2)%2C%20%22%22)%2C%220%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

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
Highlighted

@MichaelAntonelli 

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(....""),)

 

Highlighted

@MichaelAntonelli 

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), "" )

Highlighted
Best Response confirmed by MichaelAntonelli (Contributor)
Solution

@MichaelAntonelli 

 

Hi there,

 

There are two ways to solve this problem.

 

1 - You must change blank cell into 0. = =IF(AVERAGE(A2>=0),AVERAGE(A2), "")

 

In this case your formula will work perfect.

 

2 - If you don't want to change, then use Iferror function. - =IFERROR(IF(AVERAGE(A2>=0),AVERAGE(A2), ""),"0")

 

 

 

Highlighted

@MichaelAntonelli 

Why do we need IF within?

=IFERROR(AVERAGE($H$15:$H15),"")

and drag down

Highlighted

@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!

Highlighted

@Sergei Baklan Thank you so very much for your help and responding. 

Highlighted
I appreciate your help and response. Thank you very much
Highlighted
I appreciate your help and time in responding. I appreciate it very much
Highlighted

@MichaelAntonelli 

Thank you for your best response mark