PROB in ONLYOFFICE: Sum Explicit Outcome Probabilities over a Range
Understand PROB with small datasets, reconstructed arithmetic and exact-source input and error caveats.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
=PROB(A2:A5,B2:B5,1,2) has the independent target 0.625 for the table below. It adds the supplied probabilities whose numeric outcomes lie in the inclusive interval from 1 to 2.
Syntax
PROB(x_range, prob_range, lower_limit, [upper_limit])
Enter a discrete probability table
Create OutcomeTable with Outcome in A1 and Probability in B1. Enter numeric outcomes 0,1,2,3 in A2:A5 and probabilities 0.125,0.25,0.375,0.25 in B2:B5. These hypothetical probabilities sum exactly to 1 and use binary-exact fractions to make total checks transparent.
Each probability belongs to the outcome on the same row. Keep both ranges aligned when sorting or editing. The outcomes need not be equally spaced, but the probabilities must describe one complete distribution for the question. PROB does not estimate these values from observations or automatically normalize arbitrary weights.
Supply the lower limit explicitly
The official help prints brackets around lower_limit in its syntax, but the pinned function declares a minimum of three arguments. Use lower_limit explicitly. Only upper_limit is optional in these examples; omitting it asks for the mass at exactly the lower value.
This is a lookup-and-sum operation over a supplied distribution, not a normal or binomial model generator. Both range arguments must represent corresponding numeric matrices. The inspected code requires the same row and column dimensions, not merely the same total number of cells.
Worked outcome intervals
| Formula | Independent target |
|---|---|
=PROB(A2:A5,B2:B5,1,2) |
0.625 |
=PROB(A2:A5,B2:B5,2) |
0.375 |
=PROB(A2:A5,B2:B5,0,3) |
1 |
=PROB(A2:A5,B2:B5,4,5) |
0 |
=PROB(A2:A5,B2:B5,2,1) |
0.625 |
The first result is 0.25+0.375. The omitted upper bound in the second row asks only for outcome 2. The reversed bounds in the final row are deliberately included: the tagged implementation swaps them, so it sums the same interval as the first row. Do not infer this behavior for other spreadsheet products from the name alone.
Advanced: repeated outcomes and explicit normalization
On a separate copy, change the outcomes to 0,1,1,3 while retaining the same probabilities. =PROB(A2:A5,B2:B5,1) then has target 0.625 because both rows with outcome 1 are included. The function does not require unique outcome labels; it adds every qualifying row’s mass.
If instead your source data are weights 1,2,3,2, put them in D2:D5 and explicitly compute =D2/SUM($D$2:$D$5) in E2, filling down. The resulting probabilities are 0.125,0.25,0.375,0.25. Passing the raw weights directly is invalid because some exceed 1 and their total is 8. Normalization is a modeling choice you perform, not an action PROB silently takes.
Weights should be nonnegative and their total positive before this normalization. Negative weights or an all-zero weight vector do not define this discrete probability distribution. Preserve the raw weights so the transformation can be audited.
Important help-versus-source error differences
Help describes probabilities strictly between 0 and 1 and says a wrong total produces #NUM!. The pinned code instead accepts individual probabilities at both endpoints, rejects values outside [0,1], and maps invalid probabilities or totals to #N/A. A valid vector 0,0,1,0 therefore gives mass 1 at outcome 2.
The total check allows an absolute difference from 1 of at most 1eā7. It does not renormalize an accepted near-one vector. Thus a table totaling 1.00000005 can return that same total for an all-outcome interval. Do not present this tolerance as exact probability normalization, or rely on a barely passing total to repair an incorrect model.
Mismatched dimensions, nonnumeric outcomes or nonnumeric probability cells also produce #N/A in the local matching loop. Blank cells are not automatically zero probabilities here. Referenced error cells in either matrix are nonnumeric and follow that #N/A path rather than necessarily preserving their original error code.
Use explicit numeric lower and upper limits. The source’s upper-limit conversion guard has a precedence issue, so this guide does not claim that textual limits are coerced symmetrically. Avoid ambiguous numeric text and verify real target-build behavior before extending these examples. Three-dimensional references and array-entry behavior are outside this scalar worksheet exercise.
Version, precision and verification
Checked October 18, 2026 against current official help and SDKJS tag v10.0.0.169, commit 3679e0375a758d7dc59d31337a45461be3525ed8. Introduction dates and a final supported-version endpoint are not established. Desktop Editors, Docs, mobile releases and imported files require separate compatibility checks.
Neither the ONLYOFFICE application nor its calculation engine was executed for this guide. The numerical targets are independently calculated mathematical values; code-path and error observations are manual source traces. They are not screenshots, displayed workbook results or promises of identical final digits. Use English function names and comma separators as shown, adapting separators to the editor’s locale.
Keep inputs and intermediate probabilities numeric and unrounded. Format the display rather than replacing values with rounded strings. These moderate scalar examples do not certify extreme-tail accuracy, unusual type coercion, array entry or dynamic spill. Model assumptions must be checked separately from arithmetic correctness.
References and related guides
- Official PROB help, checked October 18, 2026.
- Pinned implementation.
- Shared skewness helper.
- Numeric wrapper and error conversion.
- KURT.
- SKEW.
- SKEW.P.
- TRIMMEAN.