Contact

ONLYOFFICE HARMEAN: Harmonic Mean and Average Speed

Statistical Intermediate ONLYOFFICE

Use the harmonic mean in ONLYOFFICE with reciprocal checks, equal-distance travel examples and clear weighting limits.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: =HARMEAN(30,60) has an independently expected result of 40. For equal distances traveled at 30 and 60 kilometers per hour, that is the combined average speed. The arithmetic mean of 45 answers a different, equal-time question.

Availability and version history

  • Introduced: The first introduction release and date are not established by the checked sources.
  • Availability: Currently documented in ONLYOFFICE’s rolling function help; no final supported-version endpoint is established.
  • Scope: Shared Spreadsheet Editor documentation. Exact availability in individual Docs, Desktop and mobile builds is not established by this page.
  • Checked: October 14, 2026, against the official HARMEAN reference. Examples were independently calculated and compared with the vendor screenshot; these cases were not tested in the native application.

Syntax and the reciprocal calculation

=HARMEAN(number1, [number2], ...)

The official reference documents one required numeric argument and optional additional arguments, up to 255. Its screenshot uses a numeric cell range. The brackets describe optional arguments and are not typed into the formula.

For n positive values, the harmonic mean is n divided by the sum of their reciprocals. With 30 and 60, this is 2/(1/30+1/60)=40. The examples here use strictly positive numbers, avoiding undefined reciprocal operations and unverified native behavior for zero or negative inputs.

A harmonic mean is not a universal replacement for AVERAGE. Its usefulness depends on what is held equal in the underlying model.

Build a two-value comparison table

On a blank sheet, put First value, Second value, HARMEAN, Reciprocal check and Arithmetic mean in A1:E1. Enter these pairs in A2:B5:

Row A B Expected C and D Expected E
2 30 60 40 45
3 20 20 20 20
4 3 6 4 4.5
5 1 4 1.6 2.5

Enter =HARMEAN(A2:B2) in C2, =2/(1/A2+1/B2) in D2 and =AVERAGE(A2:B2) in E2. Fill C2:E2 through row 5.

The first and third rows differ by a scale factor of ten, and their harmonic means differ by the same factor. Equal inputs in row 3 give the same value back. These checks help expose a misplaced reciprocal or incorrect observation count.

Advanced: average speed over equal distances

Create a separate sheet named Travel. Put Leg, Distance km, Speed km per hour and Time hours in A1:D1. Enter 1 and 2 in A2:A3, 60 in both B2 and B3, and 30, 60 in C2:C3.

In D2 enter =B2/C2 and fill to D3. Expected times are 2 hours and 1 hour. In B5 enter =SUM(B2:B3) and in D5 enter =SUM(D2:D3); expect 120 kilometers and 3 hours.

In F2 enter =B5/D5 and in F3 enter =HARMEAN(C2:C3). Both independently expected speeds are 40 km/h. Each leg covers the same distance, so the reciprocal-time weighting implicit in the harmonic mean matches this model.

The slower leg occupies more travel time. Simply averaging 30 and 60 would ignore that and produce 45 km/h.

Change the model: equal time versus unequal distance

Use a separate sheet named EqualTime. Enter 1, 1 in A2:A3 for hours and 30, 60 in B2:B3 for speeds. Enter =A2*B2 in C2 and fill through C3. Distances are 30 and 60 kilometers.

In E2 enter =SUM(C2:C3)/SUM(A2:A3); expect 45 km/h. Here the time spent at each speed is equal, so the arithmetic mean of the speeds is appropriate.

The same numbers also show why HARMEAN is not a general unequal-distance formula. A 30-kilometer leg at 30 km/h followed by a 60-kilometer leg at 60 km/h takes two hours over 90 kilometers, again averaging 45 km/h. The unweighted HARMEAN of the two speeds remains 40 and would be inappropriate for those distances.

For unequal distances, calculate each leg’s time and use total distance divided by total time, as in the explicit model. Do not assume the function automatically infers weights from another column.

Reproduce the vendor example

On a new sheet, enter 28, 16, 878 across A1:C1 and 800, 1650, 2000 across A2:C2. Put =HARMEAN(A1:C2) in C3. Independent reciprocal arithmetic gives approximately 58.9916565094, agreeing with ONLYOFFICE’s displayed 58.991657.

For a transparent check in E3, enter =6/(1/A1+1/B1+1/C1+1/A2+1/B2+1/C2). Retain full intermediate precision and compare rounded displays or an appropriate tolerance.

Zero inputs make the reciprocal model invalid. The short help page does not specify all exact native error tokens or the treatment of negative numbers, blanks, Booleans and text in each argument form. Use validated positive numeric data for these examples.

Check units before taking any mean: kilometers per hour and meters per second cannot be combined without conversion. Confirm the model’s equal-distance or other reciprocal-weighting assumption, rather than choosing a mean from its numerical size.

AVERAGE fits the equal-time speed example. SUM makes total distance and time explicit. GEOMEAN instead combines suitable multiplicative factors.