https://bugs.documentfoundation.org/show_bug.cgi?id=167667

Luc Belzile <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Luc Belzile <[email protected]> ---
I strongly support this feature request and would like to provide a concrete
real-world use case that illustrates both the need and the performance impact
of the current workaround.

--- Real-World Use Case ---

I work with a .ods file of 5.1 MB structured as follows:
- Sheet 2: 2,519 rows × 88 columns, all cells containing formulas, with
AutoFilter enabled. This sheet draws data from Sheet 5 (up to 2,500 rows).
- 9 of the 88 columns use conditional median array formulas of the following
type:
{=MEDIAN(IF((D$20:D$2519=D20)*(F$20:F$2519=F20);J$20:J$2519))}

--- Performance Impact ---

With AutoCalculate enabled (the default setting), applying or changing a filter
on any column in Sheet 2 triggers a full recalculation of the entire sheet.
Because of the 9 array-based conditional median formulas — each iterating over
2,500 rows — each filter operation takes approximately 14 to 27 seconds, making
the file very slow to work with in practice.

I have tested the following without resolving the issue:
- Switching from .ods to .xlsx format (no significant improvement)
- Verifying that CPU and RAM are not the bottleneck (confirmed: hardware is not
the limiting factor)
- Reducing the number of conditional formatting rules (helped in Excel, but not
significantly in Calc)

This performance degradation is directly attributable to the array formula
evaluation overhead. A native MEDIAN.IF function, implemented and optimized at
the engine level — as AVERAGEIF already is — would eliminate this overhead
entirely.

--- Proposed Syntax ---

MEDIAN.IF(criteria_range; criteria; median_range)
MEDIAN.IFS(median_range; criteria_range1; criteria1; [criteria_range2;
criteria2]; ...)

This would mirror the existing AVERAGEIF / AVERAGEIFS syntax, ensuring
consistency with the rest of the conditional aggregation function family.

--- Additional Context ---

This gap is well known and has been discussed in community forums since at
least 2013. It is shared by Microsoft Excel and Google Sheets, neither of which
offers a native conditional median function as of 2026. Implementing MEDIAN.IF
natively in LibreOffice Calc would therefore be a concrete and meaningful
advantage over competing spreadsheet applications.

I hope this detailed use case helps move this enhancement forward.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to