Forum Discussion
cindy_64
Feb 27, 2022Copper Contributor
Trying to find the average of two cells and, when the answer is zero not get #DIV/0
I am trying to calculate an average, D4/A4, and when the answer is 0.00 to get that to display instead of #DIV/0 in the cell. Thanks in advance. Sample: 1 $ 5.00 $ 2.00 ...
- Feb 27, 2022You would use this formula, in case there is an error put 0
=IFERROR(D1/A1,0)
cindy_64
Feb 27, 2022Copper Contributor
Maybe my use of the word 'average' is incorrect. In this example, Column A represents the number of sales made in one department, Column B represents the total dollars sold for one item, Column C represents the total dollars sold for another item, Column D represents the sum of the value of Column B and Column C. Column E is represents Column D divided by Column A. If there were no sales, then zero is the correct answer. In Excel language, I understand why it shows #DIV/0, but I want it to present as something more aesthetic like 0.00 or -. Does that make more sense?
Feb 27, 2022
Use
=IF(A4<>0, D4/A4, 0)
=IF(A4<>0, D4/A4, 0)