Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Add 2 cells where one is 0 and show sum as a percentage

0

How do I add two cells where one is 0 and show the answer. All three cells are shown as percentages. This is what I have

A1= 96%

A2= #DIV/0!

A3= #DIV/0!

In cell A3 I have  =(A1+A2)/2   

How do I fix this so it shows the answer in cell A3 as 96%

Answer
Discuss

Answers

0
Selected Answer

The fastest way might be to use this formula in A3.

=AVERAGE($A1:$A2)

However that may not be the most beautiful. Consider eliminating the #DIV/0! error. To do that there are several ways.

=IF($B2, $B1/$B2,0)

or

=IFERROR($B1/$B2,0)

The difference is that the first formula still allows other errors to be shown. You might want to know if there is an error which is not expected! Both formulas write zero to the cell instead of #DIV/0!. If you prefer a blank cell instead, don't use "". Instead suppress the display of zero with a custom cell format, like

0%;-0%;

The final semicolon in the format will suppress the display of zero in the formatted cell.

Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login