1

I must add formulas to an Excel worksheet and I found out this is done in the following way:

String strFormula= "SUM(A1:A10)";
cell.setCellType(HSSFCell.CELL_TYPE_FORMULA);
cell.setCellFormula(strFormula);

My questions are:

  1. It may happen that the users use different language versions, means on an English system the formula will be "SUM(A1:A10)" but on a German system will be "SUMME(A1:A10)". How can I distinguish or don't I have to distinguish at all?

  2. How can I use the column- and row-index I'm using in the code also for the formular instead of the column letters? Means: How can I express the row index 1 without having to find out that is a row B ?

Thank you for your support !

1 Answers1

0

meanwhile I could find out the answers, maybe it help anyone else:

  1. It works to add the formula with the English syntax, even if the System the formula was added is running in German language.

  2. The Excel address used in the Excel frontend like "A1" can be taken from the Cell with yourCell.getaddress() and be formated as String with yourcell.getaddress().formatAsString()