Contact

LOGFIT Function (Gnumeric)

Statistical Intermediate Gnumeric

Fit a shifted logarithmic curve with Gnumeric LOGFIT and read the sign, coefficients, horizontal shift and residual sum of squares.

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

LOGFIT fits a shifted logarithmic curve to paired x and y measurements by nonlinear least squares. Its model is y = a + b*LN(sign*(x-c)), where sign is +1 or -1. Unlike a simple regression on LN(x), it also searches for a horizontal shift c and a possible reflection.

Syntax and returned parameters

LOGFIT(known_ys, known_xs)

Provide the y-values first and the corresponding x-values second. The pinned callback expects cell ranges, collects numerical values from each, and requires matching numerical counts of at least three. Keep complete numerical pairs in aligned rows; independently ignored text or blanks can otherwise disturb the intended pairing.

The returned array has one row and five columns:

  1. sign
  2. a
  3. b
  4. c
  5. Sum of squared residuals

Read individual elements with INDEX when you want scalar cells without relying on GUI array-entry behavior.

Worked example: recover a known curve

Put 2, 3, 4, 5, and 6 in B1:B5. In C1 enter =2+3*LN(B1-1) and fill down through C5. These values come from a known model with sign=1, a=2, b=3, and c=1.

Formula Native result
=INDEX(LOGFIT(C1:C5,B1:B5),1,1) 1
=INDEX(LOGFIT(C1:C5,B1:B5),1,2) 2
=INDEX(LOGFIT(C1:C5,B1:B5),1,3) 3
=INDEX(LOGFIT(C1:C5,B1:B5),1,4) 1
=INDEX(LOGFIT(C1:C5,B1:B5),1,5) 0

The zero residual sum is expected for this exact synthetic curve and does not imply that real calibration data will fit exactly. The fixture verifies parameter order and model reconstruction, not the reliability of every nonlinear fit.

Advanced use: prediction and domain checks

After fitting, evaluate a+b*LN(sign*(x-c)) only where sign*(x-c) is positive. That logarithm-domain condition is essential. A fitted curve may describe the observed region reasonably while behaving poorly near its asymptote or far outside the sample range.

The documented inverse is EXP((y-a)/b)/sign+c, provided the fitted b is nonzero and the problem’s domain permits the requested value. Review the fit and residuals before using it to infer an unknown measurement.

Gnumeric’s help explicitly describes a trial-and-error procedure and warns that a returned fit may not be the best possible. It gives the c resolution as a power-of-ten scale based on the x-range times one millionth. Do not present the displayed parameter digits as a universal accuracy guarantee or statistical confidence interval.

Errors and troubleshooting

=LOGFIT(C1:C2,B1:B2) returns #VALUE! in the native check because there are only two numerical pairs. The source also rejects mismatched collected counts. An unsuccessful numerical fit returns #NUM!; the documentation warns about fewer than three distinct x or y values and data whose shape is unsuitable for the model.

Use clean, paired numerical ranges. A missing value in only one column can invalidate the intended pairing even if the total remaining counts happen to match. Keep the original observations and inspect the residual pattern instead of relying only on a small sum of squares.

Version and verification

This guide is pinned to official Gnumeric 1.12.57 source and six native checks under C.UTF-8 on 17 October 2026. The known-curve parameters independently define the expected result. The original introduction release is not established, and no retirement is inferred. GUI array entry, extreme data, and global-optimum convergence are not certified.

INDEX reads the parameter array. LN and EXP express the forward and inverse model once its domain has been checked.

Official references