diff --git a/base/src/functions/statistical.rs b/base/src/functions/statistical.rs index a7d0825..140e6b8 100644 --- a/base/src/functions/statistical.rs +++ b/base/src/functions/statistical.rs @@ -636,7 +636,7 @@ impl Model { CalcResult::Number(max) } - pub(crate) fn fn_geomean(&mut self, args: &[Node], cell: CellReferenceIndex) -> CalcResult{ + pub(crate) fn fn_geomean(&mut self, args: &[Node], cell: CellReferenceIndex) -> CalcResult { if args.is_empty() { return CalcResult::new_args_number_error(cell); } @@ -714,6 +714,6 @@ impl Model { message: "Division by Zero".to_string(), }; } - CalcResult::Number(product.powf(1.0/count)) + CalcResult::Number(product.powf(1.0 / count)) } } diff --git a/base/src/test/mod.rs b/base/src/test/mod.rs index 7edb7f3..9f67c79 100644 --- a/base/src/test/mod.rs +++ b/base/src/test/mod.rs @@ -52,6 +52,7 @@ mod test_escape_quotes; mod test_extend; mod test_fn_type; mod test_frozen_rows_and_columns; +mod test_geomean; mod test_get_cell_content; mod test_issue_155; mod test_percentage; @@ -59,4 +60,3 @@ mod test_set_functions_error_handling; mod test_today; mod test_types; mod user_model; -mod test_geomean; diff --git a/docs/src/functions/statistical.md b/docs/src/functions/statistical.md index 9bd1909..6842212 100644 --- a/docs/src/functions/statistical.md +++ b/docs/src/functions/statistical.md @@ -9,13 +9,13 @@ lang: en-US At the moment IronCalc only supports a few function in this section. You can track the progress in this [GitHub issue](https://github.com/ironcalc/IronCalc/issues/55). -| Function | Status | Documentation | -| ------------------------ | ---------------------------------------------- | ------------- | +| Function | Status | Documentation | +| ------------------------ |--------------------------------------------------| ------------- | | AVEDEV | | – | -| AVERAGE | | – | -| AVERAGEA | | – | -| AVERAGEIF | | – | -| AVERAGEIFS | | – | +| AVERAGE | | – | +| AVERAGEA | | – | +| AVERAGEIF | | – | +| AVERAGEIFS | | – | | BETA.DIST | | – | | BETA.INV | | – | | BINOM.DIST | | – | @@ -29,11 +29,11 @@ You can track the progress in this [GitHub issue](https://github.com/ironcalc/Ir | CONFIDENCE.NORM | | – | | CONFIDENCE.T | | – | | CORREL | | – | -| COUNT | | – | -| COUNTA | | – | -| COUNTBLANK | | – | -| COUNTIF | | – | -| COUNTIFS | | – | +| COUNT | | – | +| COUNTA | | – | +| COUNTBLANK | | – | +| COUNTIF | | – | +| COUNTIFS | | – | | COVARIANCE.P | | – | | COVARIANCE.S | | – | | DEVSQ | | – | @@ -58,7 +58,7 @@ You can track the progress in this [GitHub issue](https://github.com/ironcalc/Ir | GAMMALN | | – | | GAMMALN.PRECISE | | – | | GAUSS | | – | -| GEOMEAN | | – | +| GEOMEAN | | – | | GROWTH | | – | | HARMEAN | | – | | HYPGEOM.DIST | | – | @@ -69,9 +69,9 @@ You can track the progress in this [GitHub issue](https://github.com/ironcalc/Ir | LOGEST | | – | | LOGNORM.DIST | | – | | LOGNORM.INV | | – | -| MAX | | – | +| MAX | | – | | MAXA | | – | -| MAXIFS | | – | +| MAXIFS | | – | | MEDIAN | | – | | MODE.MULT | | – | | MODE.SNGL | | – | diff --git a/docs/src/functions/statistical/geomean.md b/docs/src/functions/statistical/geomean.md index fc2cf32..322000e 100644 --- a/docs/src/functions/statistical/geomean.md +++ b/docs/src/functions/statistical/geomean.md @@ -7,6 +7,5 @@ lang: en-US # GEOMEAN ::: warning -🚧 This function is not yet available in IronCalc. -[Follow development here](https://github.com/ironcalc/IronCalc/labels/Functions) +🚧 This function is implemented but currently lacks detailed documentation. For guidance, you may refer to the equivalent functionality in [Microsoft Excel documentation](https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb). ::: \ No newline at end of file diff --git a/xlsx/tests/calc_tests/GEOMEAN.xlsx b/xlsx/tests/calc_tests/GEOMEAN.xlsx new file mode 100644 index 0000000..e8c7f3d Binary files /dev/null and b/xlsx/tests/calc_tests/GEOMEAN.xlsx differ