Apache OpenOffice (AOO) Bugzilla – Issue 72590
ISEVEN_ADD, ISODD_ADD functions incorrect
Last modified: 2013-08-07 15:12:27 UTC
According to the Help these are supposed to be compatible with Excel. It would therefore be useful if they returned a logical value not a number. Hmm. As far as I can tell they produce the same results as Calc ISEVEN/ODD and Excel ISEVEN/ODD for all numbers and empty cells, if you allow that 1 stands for TRUE. But ISEVEN_ADD("dog") produces a different result from Excel. Same with ISODD_ADD. All in all, not wonderful. Perhaps QA were having an off day....
drking, I can't find ISEVEN_ADD (ISODD_ADD) in the list of Excel functions.
From the Help for ISEVEN in Calc: "The functions whose names end with _ADD return the same results as the corresponding Microsoft Excel functions. Use the functions without _ADD to get results based on international standards. For example, the WEEKNUM function calculates the week number of a given date based on international standard ISO 6801, while WEEKNUM_ADD returns the same week number as Microsoft Excel." It's not very well worded, but what I think it means is that someone at OOo thought that the MS function ISEVEN did not do the job it should have. They implemented Calc ISEVEN 'properly', and provided ISEVEN_ADD to mimic what Excel does. So you should be comparing Calc ISEVEN_ADD with MS ISEVEN. Hope that is clearer, and thanks. This has arisen because I am revising the Help wording. It's a bit glaring when every other Calc IS.. function returns TRUE or FALSE. Specifically the formula =ISLOGICAL(ISEVEN_ADD(...)) returns FALSE - but =ISLOGICAL(ISEVEN (...)) returns TRUE.
Created attachment 41492 [details] iseven_add / odd review
Confirmed: return type of ISEVEN_ADD() differs from Excel. Related documentation issues: documentation (English 2.1 anyway) does not make clear what the distinction between ISEVEN() and ISEVEN_ADD() is supposed to be. Also, ISEVEN() docs do not describe behavior for noninteger arguments. It appears to truncate, like Excel, but this is not documented.
Thank you. The proposed new HELP wording for ISEVEN / ISODD is at issue 71289. Part of it says: "If 'value' is not an integer any digits after the decimal point are ignored." In fact this function should be moved to the Information Category of Help, alongside ISEVEN_ADD. My proposed wording in that Category (unpublished as yet) adds: "The sign of value is also ignored." The proposed documentation for ISEVEN_ADD / ISODD_ADD rather skirts round the problem(!) - because the functions currently appear not to work as intended.
Daniel, this is yours. With string arguments ISEVEN_ADD / ISODD_ADD need to throw a different exception than lang::IllegalArgumentException to produce the errNoValue error code.
drigdway said: "Also, ISEVEN() docs do not describe behavior for noninteger arguments. It appears to truncate, like Excel, but this is not documented." The test appears to be: ( fmod( ::rtl::math::approxFloor( fabs( fVal ) ), 2.0 ) < 0.5 ) where fVal is being tested so indeed it does ignore anything after the decimal point, and my proposed Help text is OK.
I can't find any other add-in function which returns a logical value (TRUE or FALSE). Of those that might: ISLEAPYEAR() returns 1 or 0 (yuk), but this function is not implemented in Excel GESTEP() and DELTA() return 1 or 0, which is the same as Excel. Just thought that info might be helpful...
started
target OOo Later, needs changing the ::com:.sun::star::sheet::addin::XAnalysis interface.