Apache OpenOffice (AOO) Bugzilla – Issue 104761
CURRENT() does not seem to work inside nested functions
Last modified: 2013-03-25 11:32:55 UTC
The OOCalc formula function CURRENT() does work when it is used as an argument for another function, but not when that function is itself an argument for a third function. For example, the following two formulae produce exactly the same output, as one should expect (with B1 holding a number, and A1:A5 a list of five numbers sorted in ascending order): = MATCH( B1; A1:A5 ) = B1 + MATCH( CURRENT(); A1:A5 ) - B1 Similarly, one should also expect the following two formulae to produce the same output as each other: = INDEX( A1:A5; MATCH( B1; A1:A5 )) = B1 + INDEX( A1:A5; MATCH( CURRENT(); A1:A5 )) - B1 However, while the first one returns the proper value from the list A1:A5, the second one causes a #VALUE! error. The simple example given is of course rather useless, but I do have a spreadsheet where I would like to set conditional STYLE() values depending on rather complex value lookups based on the CURRENT() cell value, which this bug seems to unfortunately make impossible.
The fourth item in description returns 1 for no apparent reason. Rev. 1400866
"based on the CURRENT() cell value" CURRENT() is not the cell value, but it is the intermediate calculation result while calculating the formula. And I'm not sure about the internal order of calculation in case of function INDEX. For example =INDEX( A1:A5; B1+MATCH( CURRENT(); A1:A5 )-B1) will work. I guess, that you can use a total different and easier way to get your goal. You should discuss the problem in a mailing list or forum. http://wiki.openoffice.org/wiki/Communication