diff --git a/Axel/resources/summe.csv b/Axel/resources/summe.csv new file mode 100644 index 0000000..50d75e1 --- /dev/null +++ b/Axel/resources/summe.csv @@ -0,0 +1,10 @@ +=SUMME(C1:E2),,=1,=2,=3,,,,, +,,=4,=5,=6,,,,, +,,,,=0,,,,, +,,,,=0,,,,, +,,,,,,,,, +,,,,,,,,, +,,,,,,,,, +,,,,,,,,, +,,,,,,,,, +,,,,,,,,, diff --git a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java index 065264f..91c295e 100644 --- a/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java +++ b/Axel/src/de/hs_mannheim/informatik/spreadsheet/Spreadsheet.java @@ -155,8 +155,11 @@ public class Spreadsheet { } else if (formula.startsWith("PRODUKT(")) {// e.g. PRODUKT(A3:B9) + String[] onlyCells = formula.substring(8, formula.length() - 1).split(":"); - result = "TODO"; // TODO + if(checkIfCellExists(onlyCells[0])&&checkIfCellExists(onlyCells[1])) { + result = "" + pro(onlyCells[0], onlyCells[1]); + } } @@ -200,7 +203,7 @@ public class Spreadsheet { private long pro(String startCellName, String endCellName) { int werte[]=getValues(startCellName,endCellName); - int produkt=0; + int produkt=1; for(int i=0;i