From dd9ff48a4e090273859d60760683b7003ed49b22 Mon Sep 17 00:00:00 2001 From: selim Date: Tue, 26 Dec 2023 18:04:38 +0100 Subject: [PATCH] Spreadsheet evaluateCell average fix. --- .../de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java index 3149129..435847d 100644 --- a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java @@ -187,11 +187,11 @@ public class Spreadsheet { else if (formula.startsWith("MITTELWERT(")) // e.g. MITTELWERT(A3:A5) - if (formula.length() < 17) + if (formula.length() < 18) result = "" + average(substringStartCell1, substringEndCell1); - else if (formula.length() < 18) - result = "" + average(substringStartCell2, substringEndCell2); else if (formula.length() < 19) + result = "" + average(substringStartCell2, substringEndCell2); + else if (formula.length() < 20) result = "" + average(substringStartCell3, substringEndCell2); else result = "0";