Contact

HARMEAN Function (Gnumeric)

Statistical Intermediate Gnumeric

Learn the HARMEAN function in Gnumeric: Returns the harmonic mean of a sample.

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

Validation limits: Examples were checked by independent arithmetic and the checksum-verified official Gnumeric 1.12.62 source. No native Gnumeric execution, screenshots, locale regression or workbook round-trip was performed.

Availability and version history

  • Introduced: Documented by 1.12.62; original introduction not established.
  • Availability: Supported in Gnumeric 1.12.62, based on the function-specific registration.
  • Scope: Desktop; the fn-stat function module must be included and enabled.
  • Checked: October 14, 2026. Documentation/source check; no new native test in Gnumeric 1.12.62.

What HARMEAN calculates

HARMEAN calculates the harmonic mean: for N numerical observations, divide N by the sum of their reciprocals. It is especially useful for rates when each observation applies to an equal quantity of work or distance. For example, travelling the same distance at 60 km/h and 30 km/h gives an average travel speed of 40 km/h, not the arithmetic average of 45 km/h. Gnumeric documents the reciprocal formula and names HARMEAN as Excel-compatible (Gnumeric Statistics manual, accessed 2026-10-13).

This is not a universal alternative to AVERAGE: it is inappropriate when every measurement instead represents an equal elapsed time, or when observations are not comparable rates. The mathematical choice of average matters more than spreadsheet branding.

Official Gnumeric syntax and parameters

=HARMEAN(number1,number2,…)
Argument Order Purpose
number1 First First numeric rate/observation or a reference to a range of observations.
number2 Second Second observation or range; additional observations may follow.

This is the exact synopsis in Gnumeric’s Statistics manual. There is no weighting argument or stated numeric default. A range is the usual input (for example =HARMEAN(B2:B5)). Gnumeric’s 1.12.62 statistical-function callback collects numeric observations, ignoring text, Booleans and blanks in worksheet ranges; it uses a numeric error fallback if its callback fails, but this research has not executed its edge cases on Gnumeric. These implementation details were cross-checked in the indexed 1.12.62 source documentation, which identifies gnumeric_harmean and gnm_range_harmonic_mean().

Version/platform: Scope is the upstream Gnumeric 1.12.62 September 2026 desktop source and documentation. The official function catalogue identifies HARMEAN as Complete / Basic testing, rather than partially implemented; this is not proof of execution in a local Gnumeric installation (function catalogue, accessed 2026-10-13). Locale: Illustrations use English names, . decimals and , separators; a decimal-comma locale may require ; for argument separation; Gnumeric’s function-insertion dialog selects local punctuation (project list archive, accessed 2026-10-13).

Example 1: Average speed across equal distances

Consider a driver who covers two equal-distance road segments at different constant speeds:

Cell Value Meaning
A1 Segment Heading
B1 Speed (km/h) Heading
A2 1 First segment
B2 60 Speed on segment 1
A3 2 Second segment
B3 30 Speed on segment 2
C2 =HARMEAN(B2:B3) Average speed over equal distances

Expected C2: 40 km/h. Independent check: assume each distance is 60 km. The first takes 1 hour; the second takes 2 hours. Total distance is 120 km and total time 3 hours, so 120/3 = 40 km/h. The formula is equivalent to 2/(1/60+1/30). For equal time spent at each speed, the arithmetic average (=AVERAGE(B2:B3), expected 45) would instead be appropriate. This crucial assumption is a rate-math derivation, not a Gnumeric-only feature.

Example 2: Reproducible numeric cases

Formula Expected output Independent reason
=HARMEAN(2,3,6) 3 3/(1/2+1/3+1/6) = 3.
=HARMEAN(20,30,60) 30 Reciprocal sum is 1/10, so 3/(1/10) = 30.
=HARMEAN(3,6,9) 4.909090909… 3/(1/3+1/6+1/9) = 54/11.
=HARMEAN(2,4,8) 3.428571429… 3/(1/2+1/4+1/8) = 24/7.

All numbers are expected independently calculated results based on the official formula. The displayed precision depends on cell formatting. With input table A2:A4 = 20, 30, 60, =HARMEAN(A2:A4) is expected to be 30.

Advanced case: When different distances demand a weighted rate

HARMEAN without weights assumes each of the listed speeds corresponds to an equal amount of distance or work. Suppose you actually drive 100 km at 50 km/h, then 50 km at 25 km/h. Since the distances differ, the correct overall average speed is total distance / total time:

Row A (distance, km) B (speed, km/h) C (hours)
2 100 50 =A2/B2 → expected 2
3 50 25 =A3/B3 → expected 2

Enter =SUM(A2:A3)/SUM(C2:C3) in D2; expected 37.5 km/h, because 150 km / 4 h = 37.5 km/h. In contrast, =HARMEAN(B2:B3) would return about 33.3333, not the correct overall weighted distance/time result. This is a practical rule for deciding when not to use HARMEAN.

For an equal-work productivity measure (equal-sized tasks with different tasks/hour completion rates), the same reciprocal reasoning can apply. Verify that units are consistent and task quantities genuinely equal before using a harmonic average.

Error cases, restrictions and fixes

Issue Appropriate interpretation and action
0 among rates A reciprocal of zero is undefined for the positive-rate model. Review and clean it; the precise displayed Gnumeric error has not been natively established for every zero-input arrangement.
Negative rates The positive-rate use case assumes positive values. Negative rates may be inappropriate or make denominators ambiguous; do not invent an error code without executing this Gnumeric version.
No numeric entries The intended harmonic mean has no valid rate inputs. Check COUNT(B2:B5) and imported number types; runtime error display is not asserted.
Number imported as text Gnumeric’s collection callback ignores text worksheet cells rather than reading them as observed rates. Correct parsing instead of silently accepting partial data.
Using time-weighted data For equal time, AVERAGE may be appropriate instead; for unequal distances/times, use SUM(distance)/SUM(time) using compatible units.
Formula uses the wrong punctuation Verify decimal and argument separators under local formula settings; use Insert → Function.
Input has a cell error Locate the upstream error and resolve it; do not assume the function will silently ignore error cells.

For a range known to contain only numeric values, a worksheet guard is =IF(MIN(B2:B3)>0,HARMEAN(B2:B3),"Check positive speeds"). This guards against nonpositive numerics in that small scenario, not against all imported text or missing values. The upstream 1.12.62 C implementation uses a GNM_ERROR_NUM callback fallback, but an exact zero/negative input-to-error map remains pending native validation. The official manual does not enumerate these edge-case outcomes.

Gnumeric describes HARMEAN as Excel-compatible. That means the function and broad mathematical contract are shared; edge-case error reporting, coercion, precision and locale must still be verified separately rather than borrowed from Excel or LibreOffice. Catalogue Complete / Basic is the project’s classification, not a validation stamp for this manuscript.

  • GEOMEAN summarizes positive multiplicative factors rather than rates.
  • AVERAGE finds the arithmetic mean, useful for equal-time speed observations.
  • SUM aggregates distances and durations in the weighted travel example.
  • COUNT helps identify whether a range has numeric values.
  • IF adds known-domain guards where appropriate.

Primary source verification: The official Gnumeric 1.12.62 source archive was checked against GNOME’s SHA-256 checksum. The statistical callback and collector flags were inspected without compiling or running Gnumeric.

Official references, claim evidence and validation

  1. Gnumeric Statistics manual, HARMEAN, accessed 2026-10-13 — exact synopsis/argument order, harmonic mean definition, Excel compatibility and related functions.
  2. Gnumeric catalogue, accessed 2026-10-13 — registration, Complete and Basic project-testing classification.
  3. Gnumeric 1.12.62 official announcement, accessed 2026-10-13 — current release scope, not specific HARMEAN behavior evidence.
  4. Gnumeric 1.12 release files, accessed 2026-10-13 — stable release archive; the official source archive was checksum-verified and inspected without compilation.
  5. Gnumeric 1.12.62 source-function documentation, accessed 2026-10-13 via indexed excerpts — gnumeric_harmean registration callback, collection and #NUM! fallback. These details were additionally confirmed in the checksum-verified official source archive; no native execution was performed.
  6. GNOME Gnumeric mailing-list answer on separators, accessed 2026-10-13 — localized argument-separator guidance.

Validation limits: Examples were checked by independent arithmetic and the checksum-verified official Gnumeric 1.12.62 source. No native Gnumeric execution, screenshots, locale regression or workbook round-trip was performed.