Divide by zero error in cell range

Hi,

I would like a formula modified to avoid getting divide by zero errors. The formula was kindly provided by a member yesterday however
since using on a new spreadsheet containing zeros it throws up the errors.
Please refer to attached spreadsheet   The zero is highlighted Sum-Probabilities-to-one-V2.xlsxin cell B17
Many thanks
Ian
Ian BellretiredAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Hi Ian,

Try this Array Formula which requires confirmation with Ctrl+Shift+Enter instead of Enter alone.

In E2
=IFERROR(1/B2/ROUND(SUM(($A$2:$A$31=A2)*($B$2:$B$31<>0)/IF($B$2:$B$31=0,1,$B$2:$B$31)),2),0)

Open in new window

0
Ian BellretiredAuthor Commented:
Hi Neeraj,
I was wanting it to establish the probs and the sum of the range would add to 1.
Please refer to attached sheet.
You have corrected the divide by zero error but the formula needs adjusting.
Thanks
Ian
Sum-Probabilities-to-one.xlsx
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Hi Ian,

I am not sure if I am getting you here.
Please look at the attached. The new formula is placed in column G and sum is placed in column H. What is missing in there?
Sum-Probabilities-to-one.xlsx
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Ian BellretiredAuthor Commented:
Worked okay, not sure what I did earlier as output was 1 for each cell.
However this formula is not practical for the 160,000 rows and 78 columns as it takes hours to calculate
despite my computer being high spec with an i9 16 core processor, 64 GB Ram and a 1TB Evo SSD
it maxes out my CPU and will need helper columns.
1
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Yes, I agree. For that much of large data set, helper columns would be the best approach.
BTW good system configuration. I wish, one day I will have a system with same configuration. Let me know if you ever want to exchange your system with less powered system like mine. Lol
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ian BellretiredAuthor Commented:
Thanks again Neeraj.
I think my computer is too heavy to ship :)
1
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome Ian!

I think my computer is too heavy to ship :)
LOL...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Spreadsheets

From novice to tech pro — start learning today.