Please notice, we have logged a ticket with an id “CELLSJAVA-43305” for your issue. We will look into it soon. The issue logged as following:
CELLSJAVA-43305 - EOMONTH formula/function calculation error on Russian locale
Once we have an update on it, we will let you know.
@makarovalv,
What is the expected result for the formula? The recognizable datetime value for EOMONTH depends on the regional settings. For your template, “04.09.2020” cannot be taken as a valid datetime value with common regions such as en_US and the formula
=EOMONTH("04.09.2020",0)
will give #VALUE! in ms excel too. To get the expected result, you should specified the region as Russia. Example code:
Workbook workbook = new Workbook("C://in.xlsx");
workbook.getSettings().setRegion(CountryCode.RUSSIA);
...
In this way the formula will be calculated as expected.
we got result (for the last line “cell.getDisplayStringValue()”) as “31/1/1900” which is fine. We also tested in MS Excel and got the same results. the value MS Excel gives is also 31. In short, this is not an issue with the APIs and we cannot fix it.
I guess you are talking about the test case you provided in the post, is not it? We are very sorry but how could we solve it in your way only. It looks you want to get same result for different values of TransitionEvaluation option. We cannot discard this option for the sake of your requirements. We have to keep the behavior same and consistent with MS Excel. Also, there are other users who need this option which works in the same way with MS Excel.
So, can you explain why TransitionEvaluation affects this calculation in this wrong way? What kind of behavior changes, when we set on TransitionEvaluation.
Please note, that MS Excel correctly performs this formula for both TransitionEvaluation modes (in Russian locale).
We found when we change the TransitionEvaluation mode for your template file (in.xlsx) with the locale set as Russian, if TransitionEvaluation option is checked, cell B2 shows “31.01.1900”. But when uncheck this option, cell B2 shows “30.09.2020”. So we do not get the same results for this option as you said, even though with Russian locale.
Thanks for your confirmation and glad to hear that you understand the case now. In the event of further queries or issue, feel free to contact us any time, we will be happy to assist you soon.