Err:508

Discuss the spreadsheet application

Err:508

Postby KHousley » Sat Oct 24, 2009 3:51 am

I have OpenOffice 3.0.1 OOO300m15 (Build:9379) on Linux kubuntu 9.04. I got an error in Calc when I tried to enter a formula for changing the background color of a cell when it is non-zero. First, I created a style named "ORANGE" and then tried to enter this formula:

=(D4-E4)+(H4+(STYLE(IF(CURRENT()=0; "DEFAULT"; "ORANGE"))))

The error says at the bottom of the window "Error: in bracketing".

I tried editing the formula in a separate editor before I copy-pasted it into the cell. In the editor which automatically checks for paired parenthesis, the editor says that all pairs are matched. In the functions (organized by category) section of the documentation there are a couple of examples showing how to use an "IF" function as an argument to the "STYLE" function as I have done. Also, I have tried taking the "IF" function out and replacing it with simply "ORANGE" as the argument to the STYLE function and that gives me an orange background always with no error.

Has anyone else had a problem with this error? What can I do to change the cell to an orange background only when (D4-E4)+H4 is non-zero?

Thanks,
KHousley
OpenOffice 3.0 on kubuntu 9.04
KHousley
 
Posts: 2
Joined: Sat Oct 24, 2009 2:38 am

Re: Err:508

Postby FJCC » Sat Oct 24, 2009 4:45 am

I think the problem is that the CURRENT() function is evaluated while there are still open parenthesis in the part of the formula before the STYLE function. On my system the formula doesn't produce an error, but it doesn't evaluate correctly either. The ORANGE style is never applied. This version, with fewer parenthesis does work.

Code: Select all   Expand viewCollapse view
=D4-E4+H4+STYLE(IF(CURRENT()=0; "DEFAULT"; "ORANGE"))
AOO 3.4 or 4.0 on MS Windows XP ( before 2013-08-03) or Windows 7
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 3678
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Err:508

Postby KHousley » Sat Oct 24, 2009 5:57 pm

Thanks, FJCC, for your reply. I copy-pasted your code into the cell, and still got the same error. I cut it down still further and still got the error until I cut it down to

Code: Select all   Expand viewCollapse view
=(D4-E4)+H4+STYLE("ORANGE")


which, of course, always gives me the orange background regardless of the value of the cell, but it gives me the correct value of the cell.

By the way, I looked on the "Survival Guide" for BBCode, and found nothing about it. How can I find our more about BBCode? After looking at the page source, I am guessing about how to create the CODE box that I see you and others have used.

KHousley
OpenOffice 3.0 on kubuntu 9.04
KHousley
 
Posts: 2
Joined: Sat Oct 24, 2009 2:38 am

Re: Err:508

Postby Hagar Delest » Sat Oct 24, 2009 7:40 pm

There are buttons just above the message area when you reply. Just click the button and preview the message if needed.
AOO 4.0.1 on Windows 7 and Xubuntu 14.04 (Trusty Tahr)
User avatar
Hagar Delest
Moderator
 
Posts: 25105
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Err:508

Postby FJCC » Sat Oct 24, 2009 7:55 pm

I can't explain why the formula doesn't work. I did find this issue listed on the Issue Tracker with the status Unconfirmed. The reporter is also on Linux, though not the same OOo version as yours. I don't seem to see the problem on my StarOffice 9.1 on XP. You could add your information to that thread, which would help the developers see that it is not just one user.
A work around for your problem would be to use conditional formatting. Go to Format -> Conditional Formatting and set "Cell value is", "not equal to", 0 and the Cell Style to ORANGE.
AOO 3.4 or 4.0 on MS Windows XP ( before 2013-08-03) or Windows 7
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 3678
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Err:508

Postby Hagar Delest » Sat Oct 24, 2009 8:02 pm

AOO 4.0.1 on Windows 7 and Xubuntu 14.04 (Trusty Tahr)
User avatar
Hagar Delest
Moderator
 
Posts: 25105
Joined: Sun Oct 07, 2007 9:07 pm
Location: France


Return to Calc

Who is online

Users browsing this forum: No registered users and 24 guests