OPT_PROB_HIT in LibreOffice: Barrier-Hitting Probability Examples
Use LibreOffice OPT_PROB_HIT for a modeled barrier hit before maturity. Compare eight checked cases, upper and lower limits, and terminal-price probabilities.
Verification status: Eight ordinary single-barrier expressions recalculated through documented ODF identities in LibreOfficeDev 26.8.0.0.alpha0, headlessly. Exact identities, values and controls match independent model checks. Numerical helper unavailable; 26.8.1.1 source only, with no stable or GUI test. How formula examples are checked
Quick answer: =OPT_PROB_HIT(30;0.2;0.3;1;0;40) returned 0.611908289071 in the checked development build. It matches the independent diffusion-model calculation and the rounded official Help example.
Availability and version history
- Introduced: LibreOffice 4.0, explicitly stated in function-specific Help.
- Supported in: 26.8 Help and 26.8.1.1 registration; no retirement is established.
- Scope: Desktop Calc’s Pricing add-in. English names are source-mapped to documented ODF service names.
- Checked: October 14, 2026. Eight ordinary single-barrier expressions recalculated through documented ODF identities in LibreOfficeDev 26.8.0.0.alpha0, headlessly. Stable releases, GUI entry and 26.8.1.1 execution remain untested.
What OPT_PROB_HIT measures
OPT_PROB_HIT returns a modeled probability of reaching a specified price barrier during the time interval. A hit can count even if the asset subsequently returns to the other side before maturity. This is a path event, unlike a question about the final price alone.
The function uses the documented geometric price-diffusion assumptions. Its result is a decimal probability: 0.611908289071 corresponds to approximately 61.190829%. It is not an option premium, an expected payoff or a frequency measured from historical observations. Function-specific Help.
Syntax and arguments
OPT_PROB_HIT(Spot; Volatility; Drift; Maturity; LowerBarrier; UpperBarrier)
All six arguments are required. Spot is a positive starting price. Volatility is a positive annual decimal volatility, such as 0.2 for 20%. Drift is the annual decimal price drift. Maturity is the horizon in years; 0.5 means half a year.
LowerBarrier and UpperBarrier are price levels. Use zero to disable the corresponding limit. Each saved example has exactly one active barrier, strictly below or above the initial spot. Supplying both barriers describes a different path event and was not part of these selected checks.
There is no Strike argument. The checked Help argument prose contains a stray Strike description, but its six-argument syntax and the complete source signature agree: do not insert a strike or a call/put flag into this function. Complete wrapper.
Eight ordinary model examples
Each expression below was evaluated using its documented qualified ODF service identity. The table shows the corresponding English function spelling. The independent values were computed to 110 decimal digits and cross-checked by numerical density integration; both columns are displayed to twelve decimal places. All inputs are illustrative model parameters.
| Formula | Independent model reference | LibreOfficeDev result |
|---|---|---|
=OPT_PROB_HIT(30;0.2;0.3;1;0;40) |
0.611908289071 |
0.611908289071 |
=OPT_PROB_HIT(70;0.3;0.1;0.5;60;0) |
0.423889647114 |
0.423889647114 |
=OPT_PROB_HIT(100;0.2;0.05;1;0;120) |
0.412711942705 |
0.412711942705 |
=OPT_PROB_HIT(100;0.2;0.05;1;80;0) |
0.222368889223 |
0.222368889223 |
=OPT_PROB_HIT(100;0.2;-0.05;1;0;120) |
0.255263088813 |
0.255263088813 |
=OPT_PROB_HIT(100;0.2;-0.05;1;80;0) |
0.377753788527 |
0.377753788527 |
=OPT_PROB_HIT(100;0.2;0.05;0.5;0;120) |
0.225467047213 |
0.225467047213 |
=OPT_PROB_HIT(100;0.2;0.05;2;80;0) |
0.360207584607 |
0.360207584607 |
Practical worksheet
For an upper barrier example, set A2=100, B2=0.2, C2=0.05, D2=1, E2=0 and F2=120. Use =OPT_PROB_HIT(A2;B2;C2;D2;E2;F2). The independent and saved direct-argument result is 0.412711942705, approximately 41.271194%. The referenced-cell layout is a recipe; only the explicit table expressions were executed.
For the same initial price, volatility, drift and horizon, set E2=80 and F2=0 to examine a lower barrier. The result is 0.222368889223. The positive drift makes these upper and lower situations asymmetric. They are not complementary events: a path can hit neither barrier, or potentially visit both.
The final two rows vary the horizon. Keep the time unit consistent with annual volatility and annual drift; passing a day count such as 180 directly would request 180 years, not roughly half a year.
Advanced interpretation and independent checks
An independent single-upper-barrier calculation follows the log-price process. For an upper barrier H greater than S, let a = ln(H/S), m = μ − σ²/2, and q = σ×sqrt(T). With Φ denoting the standard normal cumulative probability, the hit probability is:
Φ((m×T − a)/q) + exp(2×m×a/σ²) × Φ((−m×T − a)/q)
For a lower barrier L below S, use a = ln(S/L) and replace m by −m. The independent references were also checked by integrating the first-passage-time density from zero to T, rather than simply copying the displayed function results.
With S=100, σ=0.2, μ=0.05, T=1 and upper barrier 120, the hit probability is 0.412711942705. The separate independent probability of finishing above 120 is only 0.223147063841. Their difference, 0.189564878865, represents paths that reach the upper level but finish below it under this continuous model. For lower barrier 80, the corresponding hit and terminal-below probabilities are 0.222368889223 and 0.102807074403.
Multiplying the initial price and active barrier by ten leaves the ratio inside the logarithm unchanged, giving the same probability with unchanged volatility, drift and horizon. This scaling identity was independently checked for both Help examples.
Do not estimate a two-barrier hit probability by adding the two one-barrier answers. Some paths can hit both, so that sum counts their intersection twice. The numerical two-barrier helper was not inspected or executed here.
Boundaries and model assumptions
The complete wrapper rejects nonpositive Spot or Volatility and negative Maturity. It delegates the barrier calculation to bs::prob_hit and rejects a nonfinite returned result. It contains no separate barrier-order guard, so the wrapper alone does not establish how all unusual barrier combinations are handled.
All observed cases have positive time and an initially unhit single barrier. Zero time, already reached barriers, both active barriers, negative barrier values and extreme parameters were not executed. Exact spreadsheet error displays are not inferred from the source exception type.
The input Drift is a model parameter, not automatically an interest rate or an expected return inferred from a quote. Use one consistent model and label the chosen assumptions. A mathematical probability based on those inputs should not be described as an empirically measured chance of a market event. Inspected wrapper.
Related functions
Official evidence and checking scope
- Function-specific Help, introduction and ODF namespace
- Native registration
- Complete function wrapper
The saved application is LibreOfficeDev 26.8.0.0.alpha0, build 2c87e51eeaa2b413ff4ae097b2705eea1995d8e5, on Linux. A stale cached control changed to 3 and an uncached control returned 7. Exact ODF identities, numeric result types and all sixteen probability expressions were checked across the two related guides. Each guide’s claim covers its own eight examples. The 26.8.1.1 wrapper and input parsers were source-checked, but the underlying Black-Scholes numerical helper was unavailable. No direct English GUI entry, stable-release execution, market calibration or unlisted boundary case is claimed.