Link to home
Start Free TrialLog in
Avatar of Ian Bell
Ian BellFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Formula to sum probabilities to one within an Index Range

Hi,
I would like one formula to sum probabilities to one within an Index Range.
Please refer to attached sheet
Many thanks
IanSum-Probabilities-to-one.xlsx
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

C2      =1/B2/SUMPRODUCT(($A$2:$A$31=A2)/$B$2:$B$31)
ASKER CERTIFIED SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ian Bell

ASKER

Thanks Saqib, it works like a charm
Ian
If a cell contains a zero in column B then the whole column (E) displays a divide by zero error, how can this be corrected ?
Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks again Saqib, it takes a long time to calculate but I can run it overnight
How many rows do you have?

What is the maximum length of a set? This may help speed it up.
160,000 rows and 78 columns would contain that formula you created.
What is the maximum length of a data set who's sum needs to be 1?
That is the max length and width of the data set.
In the given sheet in column A there are 4 data sets whose sum needs to be 1. What could be the maximum length of one of those 4 data sets?
Oh I see. The maximum index range as I would understand it to be is 36 but that is very rare.
The average would be around 10-12
See if this performs any faster

=1/B2/ROUND(SUMPRODUCT((--(OFFSET($A$2,MAX(0,ROW(A2)-40),0,80)=A2))/(OFFSET($B$2,MAX(0,ROW(A2)-40),0,80)+0.00000000001)),2)
Is  -40 related to the 31 rows ? in which case if I have 159,600 rows I could use -160,000 ?
What then is  80 in the formula ?
Thanks
The 40 is an additional margin for 36 as a maximum index range.
Okay, I think I said the same in a roundabout way.
I still am curious about the 80 ?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
All understood now and many thanks Saqib
Ian