meaning and the effect of 0

View: New views
8 Messages — Rating Filter:   Alert me  

meaning and the effect of 0

by Walter Hildebrandt-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What does 0 mean and what is its effect in various condition?

 For example : When I got the formula =A1-40+IF(A1>40;STYLE("RedText");0), I
was told “The STYLE function always returns 0, so the formula is
mathematically
equal to A1-40+0”  What is effect of the 0 at the end of the formula?

 For example if “Negative numbers red” is selected (is checked) when
formatting cells, 0:[RED]-0 appears in the Format code box.

 For example I was told “Enter something like this in the format code field:
0"%" This will just add the % character right after the number, but the
number will still act as an ordinary number.”

 Also when entering the O, under different conditions, Is the 0 a zero or a
capital letter?

Re: meaning and the effect of 0

by Harold Fuchs-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/11/9 Walter Hildebrandt <wh2468@...>

> What does 0 mean and what is its effect in various condition?
>

In a numeric context, 0 means zero.
If you try to treat *text* in a numeric context then the text will usually
be treated as zero.


>  For example : When I got the formula =A1-40+IF(A1>40;STYLE("RedText");0),
> I
> was told “The STYLE function always returns 0, so the formula is
> mathematically
> equal to A1-40+0”


Correct. I don't know where you got that formula but it doesn't do anything
useful. See below.


> What is effect of the 0 at the end of the formula?
>

The syntax of an IF consists of three components:

   1. the condition
   2. what to do if the condition is true
   3. what to do if the condition is false

These are separated by semicolons. Thus your IF, which is
    IF(A1>40;STYLE("RedText");0)
says
   if the contents of cell A1 is greater than 40  [#1, the condition]
      set the current cell's value to STYLE("RedText")   [#2, what to do if
the condition is true]
   otherwise set the current cell's value to zero    [#3, what to do if the
condition is false]

However, all this is nonsense. Calc's Help on the Style function tells us
that its syntax is nothing like the one you cited and that it doesn't do
anything like what you've been told. I quote:

======== begin quote ====
Syntax

STYLE(style;time;style2)

Style is the name of a cell style assigned to the cell. Style names must be
entered in quotation marks.

Time is an optional time range in seconds. If this parameter is missing the
style will not be changed after a certain amount of time has passed.

Style2 is the optional name of a cell style assigned to the cell after a
certain amount of time has passed. If this parameter is missing "Standard"
is assumed.

===end quote ===



>  For example if “Negative numbers red” is selected (is checked) when
> formatting cells, 0:[RED]-0 appears in the Format code box.
>
>  For example I was told “Enter something like this in the format code
> field:
> 0"%" This will just add the % character right after the number, but the
> number will still act as an ordinary number.”
>

"Something like" is probably true depending on your definition of the
phrase. A dog is something like a horse, perhaps: 4 legs, tail, hair, friend
of mankind. But ...


>  Also when entering the O, under different conditions, Is the 0 a zero or a
> capital letter?
>

usually zero. A bare (unquoted) letter O would normally only be meaningful
if you had *named* something (like a print-range) "O".

Why don't you use the Conditional Formatting menu to do what you want?


--
Harold Fuchs
London, England
Please reply *only* to users@...

Re: meaning and the effect of 0

by Harold Fuchs-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/11/9 Harold Fuchs <hwfa.openoffice@...>

>
>
> 2009/11/9 Walter Hildebrandt <wh2468@...>
>
> What does 0 mean and what is its effect in various condition?
>>
>
> In a numeric context, 0 means zero.
> If you try to treat *text* in a numeric context then the text will usually
> be treated as zero.
>
>
>>  For example : When I got the formula =A1-40+IF(A1>40;STYLE("RedText");0),
>> I
>> was told “The STYLE function always returns 0, so the formula is
>> mathematically
>> equal to A1-40+0”
>
>
> Correct. I don't know where you got that formula but it doesn't do anything
> useful. See below.
>
>
>> What is effect of the 0 at the end of the formula?
>>
>
> The syntax of an IF consists of three components:
>
>    1. the condition
>    2. what to do if the condition is true
>    3. what to do if the condition is false
>
> These are separated by semicolons. Thus your IF, which is
>
>     IF(A1>40;STYLE("RedText");0)
> says
>    if the contents of cell A1 is greater than 40  [#1, the condition]
>       set the current cell's value to STYLE("RedText")   [#2, what to do if
> the condition is true]
>    otherwise set the current cell's value to zero    [#3, what to do if the
> condition is false]
>
> However, all this is nonsense. Calc's Help on the Style function tells us
> that its syntax is nothing like the one you cited and that it doesn't do
> anything like what you've been told. I quote:
>
> ======== begin quote ====
> Syntax
>
> STYLE(style;time;style2)
>
> Style is the name of a cell style assigned to the cell. Style names must be
> entered in quotation marks.
>
> Time is an optional time range in seconds. If this parameter is missing the
> style will not be changed after a certain amount of time has passed.
>
> Style2 is the optional name of a cell style assigned to the cell after a
> certain amount of time has passed. If this parameter is missing "Standard"
> is assumed.
>
> ===end quote ===
>
>
>
>>  For example if “Negative numbers red” is selected (is checked) when
>> formatting cells, 0:[RED]-0 appears in the Format code box.
>>
>>  For example I was told “Enter something like this in the format code
>> field:
>> 0"%" This will just add the % character right after the number, but the
>> number will still act as an ordinary number.”
>>
>
> "Something like" is probably true depending on your definition of the
> phrase. A dog is something like a horse, perhaps: 4 legs, tail, hair, friend
> of mankind. But ...
>
>
>>  Also when entering the O, under different conditions, Is the 0 a zero or
>> a
>> capital letter?
>>
>
> usually zero. A bare (unquoted) letter O would normally only be meaningful
> if you had *named* something (like a print-range) "O".
>
> Why don't you use the Conditional Formatting menu to do what you want?
>
>
> Sorry to reply to my own post but I've done some more research.

If you have your values in column A, then you can set column B to your
desired colours (and values) by putting in B1 the formula
   =A1+STYLE(IF(CURRENT()>40; "Red"; IF(CURRENT()<40;"Green";"Default")))
and dragging it down the column.

This will set column B to have the same *values* as column A but with the
appropriate colours.

You are *adding* ("+") the value of the Style function, which is always
zero. But the function has the *side effect* of setting the style. Note that
the If is "inside" the Style, not vice versa as you had it.

The If looks complicated but isn't. It's just the normal 3 parts separated
by semicolons. The interesting bit is that the third part of the first If is
another If, which has the usual 3 parts. Just read it carefully.


--
Harold Fuchs
London, England
Please reply *only* to users@...

Re: meaning and the effect of 0

by Walter Hildebrandt-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You ask "Why don't you use the Conditional Formatting menu to do what you
want?"  I was told that Styles was a good way to do what I wanted to do so I
decided to use Styles
I had no experience and very little understanding of either Styles or
Conditional Formatting.  I assumed Styles was easier to learn and use.  I
now have decided to learn and use Conditional Formatting instead of Styles.
I am starting by checking the OOo website to see what information is
available.

Walter

On Mon, Nov 9, 2009 at 2:49 AM, Harold Fuchs <hwfa.openoffice@...
> wrote:

> 2009/11/9 Harold Fuchs <hwfa.openoffice@...>
>
> >
> >
> > 2009/11/9 Walter Hildebrandt <wh2468@...>
> >
> > What does 0 mean and what is its effect in various condition?
> >>
> >
> > In a numeric context, 0 means zero.
> > If you try to treat *text* in a numeric context then the text will
> usually
> > be treated as zero.
> >
> >
> >>  For example : When I got the formula
> =A1-40+IF(A1>40;STYLE("RedText");0),
> >> I
> >> was told “The STYLE function always returns 0, so the formula is
> >> mathematically
> >> equal to A1-40+0”
> >
> >
> > Correct. I don't know where you got that formula but it doesn't do
> anything
> > useful. See below.
> >
> >
> >> What is effect of the 0 at the end of the formula?
> >>
> >
> > The syntax of an IF consists of three components:
> >
> >    1. the condition
> >    2. what to do if the condition is true
> >    3. what to do if the condition is false
> >
> > These are separated by semicolons. Thus your IF, which is
> >
> >     IF(A1>40;STYLE("RedText");0)
> > says
> >    if the contents of cell A1 is greater than 40  [#1, the condition]
> >       set the current cell's value to STYLE("RedText")   [#2, what to do
> if
> > the condition is true]
> >    otherwise set the current cell's value to zero    [#3, what to do if
> the
> > condition is false]
> >
> > However, all this is nonsense. Calc's Help on the Style function tells us
> > that its syntax is nothing like the one you cited and that it doesn't do
> > anything like what you've been told. I quote:
> >
> > ======== begin quote ====
> > Syntax
> >
> > STYLE(style;time;style2)
> >
> > Style is the name of a cell style assigned to the cell. Style names must
> be
> > entered in quotation marks.
> >
> > Time is an optional time range in seconds. If this parameter is missing
> the
> > style will not be changed after a certain amount of time has passed.
> >
> > Style2 is the optional name of a cell style assigned to the cell after a
> > certain amount of time has passed. If this parameter is missing
> "Standard"
> > is assumed.
> >
> > ===end quote ===
> >
> >
> >
> >>  For example if “Negative numbers red” is selected (is checked) when
> >> formatting cells, 0:[RED]-0 appears in the Format code box.
> >>
> >>  For example I was told “Enter something like this in the format code
> >> field:
> >> 0"%" This will just add the % character right after the number, but the
> >> number will still act as an ordinary number.”
> >>
> >
> > "Something like" is probably true depending on your definition of the
> > phrase. A dog is something like a horse, perhaps: 4 legs, tail, hair,
> friend
> > of mankind. But ...
> >
> >
> >>  Also when entering the O, under different conditions, Is the 0 a zero
> or
> >> a
> >> capital letter?
> >>
> >
> > usually zero. A bare (unquoted) letter O would normally only be
> meaningful
> > if you had *named* something (like a print-range) "O".
> >
> > Why don't you use the Conditional Formatting menu to do what you want?
> >
> >
> > Sorry to reply to my own post but I've done some more research.
>
> If you have your values in column A, then you can set column B to your
> desired colours (and values) by putting in B1 the formula
>   =A1+STYLE(IF(CURRENT()>40; "Red"; IF(CURRENT()<40;"Green";"Default")))
> and dragging it down the column.
>
> This will set column B to have the same *values* as column A but with the
> appropriate colours.
>
> You are *adding* ("+") the value of the Style function, which is always
> zero. But the function has the *side effect* of setting the style. Note
> that
> the If is "inside" the Style, not vice versa as you had it.
>
> The If looks complicated but isn't. It's just the normal 3 parts separated
> by semicolons. The interesting bit is that the third part of the first If
> is
> another If, which has the usual 3 parts. Just read it carefully.
>
>
> --
> Harold Fuchs
> London, England
> Please reply *only* to users@...
>

Re: meaning and the effect of 0

by Johnny Rosenberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/11/9 Harold Fuchs <hwfa.openoffice@...>:

> 2009/11/9 Walter Hildebrandt <wh2468@...>
>
>> What does 0 mean and what is its effect in various condition?
>>
>
> In a numeric context, 0 means zero.
> If you try to treat *text* in a numeric context then the text will usually
> be treated as zero.
>
>
>>  For example : When I got the formula =A1-40+IF(A1>40;STYLE("RedText");0),
>> I
>> was told “The STYLE function always returns 0, so the formula is
>> mathematically
>> equal to A1-40+0”
>
>
> Correct. I don't know where you got that formula but it doesn't do anything
> useful. See below.

Depends on what is useful… It calculates A1-40 and if A1>40 the the
cell will use the style ”RedText”. If not, it will use the current
style. In both cases, the return value is 0, so the result won't
change.

As I probably already said whan I very quickly made this formula,
there are other ways to do this, but since all methods that I knew of
already were suggested, I suggested this one as a start, ready for
development.

>
>
>> What is effect of the 0 at the end of the formula?
>>
>
> The syntax of an IF consists of three components:
>
>   1. the condition
>   2. what to do if the condition is true
>   3. what to do if the condition is false
>
> These are separated by semicolons. Thus your IF, which is
>    IF(A1>40;STYLE("RedText");0)
> says
>   if the contents of cell A1 is greater than 40  [#1, the condition]
>      set the current cell's value to STYLE("RedText")   [#2, what to do if
> the condition is true]
>   otherwise set the current cell's value to zero    [#3, what to do if the
> condition is false]
>
> However, all this is nonsense. Calc's Help on the Style function tells us
> that its syntax is nothing like the one you cited and that it doesn't do
> anything like what you've been told. I quote:

Still, it  works. Of course I tested it before sent my message.

>
> ======== begin quote ====
> Syntax
>
> STYLE(style;time;style2)
>
> Style is the name of a cell style assigned to the cell. Style names must be
> entered in quotation marks.
>
> Time is an optional time range in seconds. If this parameter is missing the
> style will not be changed after a certain amount of time has passed.
>
> Style2 is the optional name of a cell style assigned to the cell after a
> certain amount of time has passed. If this parameter is missing "Standard"
> is assumed.
>
> ===end quote ===
>
>
>
>>  For example if “Negative numbers red” is selected (is checked) when
>> formatting cells, 0:[RED]-0 appears in the Format code box.
>>
>>  For example I was told “Enter something like this in the format code
>> field:
>> 0"%" This will just add the % character right after the number, but the
>> number will still act as an ordinary number.”
>>
>
> "Something like" is probably true depending on your definition of the
> phrase. A dog is something like a horse, perhaps: 4 legs, tail, hair, friend
> of mankind. But ...
>
>
>>  Also when entering the O, under different conditions, Is the 0 a zero or a
>> capital letter?
>>
>
> usually zero. A bare (unquoted) letter O would normally only be meaningful
> if you had *named* something (like a print-range) "O".
>
> Why don't you use the Conditional Formatting menu to do what you want?
>
>
> --
> Harold Fuchs
> London, England
> Please reply *only* to users@...
>

Johnny Rosenberg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: meaning and the effect of 0

by Johnny Rosenberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/11/9 Walter Hildebrandt <wh2468@...>:

> You ask "Why don't you use the Conditional Formatting menu to do what you
> want?"  I was told that Styles was a good way to do what I wanted to do so I
> decided to use Styles
> I had no experience and very little understanding of either Styles or
> Conditional Formatting.  I assumed Styles was easier to learn and use.  I
> now have decided to learn and use Conditional Formatting instead of Styles.
> I am starting by checking the OOo website to see what information is
> available.
>
> Walter
>

As I tried to explain earlier, both methods (or all three, I think
someone suggested a third way to do the same thing) will work but they
are suitable for different situations. As I explained, Style() is very
good if you need more than three different styles depending on value
of a cell. Just name the styles in a smart way and you can do funny
stuff, and also useful stuff.
In this case, conditional formatting is just as good, if not better. I
am pretty sure I mentioned that, if not I apologize. But what's the
point mentioning the same method that somebody else already mentioned?
So I mentioned another solution.
Since I understand that you are a beginner and you seem to be
interested in learning, I just thought that I should, or at least
could, inform you about this method. Maybe it's not the most suitable
for your current problem, but as you go forward in learning this
method maybe will give you some inspiration later. Well, something
like that anyway.
I didn't mean to confuse you, sorry if that happened.

Johnny Rosenberg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: meaning and the effect of 0

by Harold Fuchs-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Walter Hildebrandt wrote:

> You ask "Why don't you use the Conditional Formatting menu to do what you
> want?"  I was told that Styles was a good way to do what I wanted to do so I
> decided to use Styles
> I had no experience and very little understanding of either Styles or
> Conditional Formatting.  I assumed Styles was easier to learn and use.  I
> now have decided to learn and use Conditional Formatting instead of Styles.
> I am starting by checking the OOo website to see what information is
> available.
>
> Walter
>
> On Mon, Nov 9, 2009 at 2:49 AM, Harold Fuchs <hwfa.openoffice@...
>  
>> wrote:
>>    
>
>  
>> 2009/11/9 Harold Fuchs <hwfa.openoffice@...>
>>
>>    
>>> 2009/11/9 Walter Hildebrandt <wh2468@...>
>>>
>>> What does 0 mean and what is its effect in various condition?
>>>      
>>> In a numeric context, 0 means zero.
>>> If you try to treat *text* in a numeric context then the text will
>>>      
>> usually
>>    
>>> be treated as zero.
>>>
>>>
>>>      
>>>>  For example : When I got the formula
>>>>        
>> =A1-40+IF(A1>40;STYLE("RedText");0),
>>    
>>>> I
>>>> was told “The STYLE function always returns 0, so the formula is
>>>> mathematically
>>>> equal to A1-40+0”
>>>>        
>>> Correct. I don't know where you got that formula but it doesn't do
>>>      
>> anything
>>    
>>> useful. See below.
>>>
>>>
>>>      
>>>> What is effect of the 0 at the end of the formula?
>>>>
>>>>        
>>> The syntax of an IF consists of three components:
>>>
>>>    1. the condition
>>>    2. what to do if the condition is true
>>>    3. what to do if the condition is false
>>>
>>> These are separated by semicolons. Thus your IF, which is
>>>
>>>     IF(A1>40;STYLE("RedText");0)
>>> says
>>>    if the contents of cell A1 is greater than 40  [#1, the condition]
>>>       set the current cell's value to STYLE("RedText")   [#2, what to do
>>>      
>> if
>>    
>>> the condition is true]
>>>    otherwise set the current cell's value to zero    [#3, what to do if
>>>      
>> the
>>    
>>> condition is false]
>>>
>>> However, all this is nonsense. Calc's Help on the Style function tells us
>>> that its syntax is nothing like the one you cited and that it doesn't do
>>> anything like what you've been told. I quote:
>>>
>>> ======== begin quote ====
>>> Syntax
>>>
>>> STYLE(style;time;style2)
>>>
>>> Style is the name of a cell style assigned to the cell. Style names must
>>>      
>> be
>>    
>>> entered in quotation marks.
>>>
>>> Time is an optional time range in seconds. If this parameter is missing
>>>      
>> the
>>    
>>> style will not be changed after a certain amount of time has passed.
>>>
>>> Style2 is the optional name of a cell style assigned to the cell after a
>>> certain amount of time has passed. If this parameter is missing
>>>      
>> "Standard"
>>    
>>> is assumed.
>>>
>>> ===end quote ===
>>>
>>>
>>>
>>>      
>>>>  For example if “Negative numbers red” is selected (is checked) when
>>>> formatting cells, 0:[RED]-0 appears in the Format code box.
>>>>
>>>>  For example I was told “Enter something like this in the format code
>>>> field:
>>>> 0"%" This will just add the % character right after the number, but the
>>>> number will still act as an ordinary number.”
>>>>
>>>>        
>>> "Something like" is probably true depending on your definition of the
>>> phrase. A dog is something like a horse, perhaps: 4 legs, tail, hair,
>>>      
>> friend
>>    
>>> of mankind. But ...
>>>
>>>
>>>      
>>>>  Also when entering the O, under different conditions, Is the 0 a zero
>>>>        
>> or
>>    
>>>> a
>>>> capital letter?
>>>>
>>>>        
>>> usually zero. A bare (unquoted) letter O would normally only be
>>>      
>> meaningful
>>    
>>> if you had *named* something (like a print-range) "O".
>>>
>>> Why don't you use the Conditional Formatting menu to do what you want?
>>>
>>>
>>> Sorry to reply to my own post but I've done some more research.
>>>      
>> If you have your values in column A, then you can set column B to your
>> desired colours (and values) by putting in B1 the formula
>>   =A1+STYLE(IF(CURRENT()>40; "Red"; IF(CURRENT()<40;"Green";"Default")))
>> and dragging it down the column.
>>
>> This will set column B to have the same *values* as column A but with the
>> appropriate colours.
>>
>> You are *adding* ("+") the value of the Style function, which is always
>> zero. But the function has the *side effect* of setting the style. Note
>> that
>> the If is "inside" the Style, not vice versa as you had it.
>>
>> The If looks complicated but isn't. It's just the normal 3 parts separated
>> by semicolons. The interesting bit is that the third part of the first If
>> is
>> another If, which has the usual 3 parts. Just read it carefully.
>>
>>
>> --
>> Harold Fuchs
>> London, England
>> Please reply *only* to users@...
>>
>>    
>
>  
See my second post (above). Brian Barker told you, in a different thread
of yours on this same subject "But using STYLE(IF()) instead of
IF(STYLE()) appears to solve the problem". This is the same as my
comment above: "Note that the If is "inside" the Style, not vice versa
as you had it."

Now that you have the correct syntax, using styles is the way to go as
they are more generally useful throughout OOo, not just in Calc.

--
Harold Fuchs
London, England
Please reply *only* to users@...


Re: meaning and the effect of 0

by Walter Hildebrandt-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Harold, you wrote the following:  "Now that you have the correct syntax,
using styles is the way to go as they are more generally useful throughout
OOo, not just in Calc."

My first decision was to use Styles instead of Conditional Formatting
because Styles seem easier for me to use than Conditional Formatting. After
using Styles for a period of time I made the decision to learn and use
Conditional Formatting.  I am now reconsidering using Styles.  Ignoring the
fact that I now have the correct syntax, what do you suggest I learn and use
(Styles or Condition Formatting)?  My biggest concern is using a very large
spreadsheet.   I use Writer and have more or less figured out how to use
Writer to my satisfaction.

Walter


On Mon, Nov 9, 2009 at 10:31 AM, Harold Fuchs <
hwfa.openoffice@...> wrote:

> Walter Hildebrandt wrote:
>
>> You ask "Why don't you use the Conditional Formatting menu to do what you
>> want?"  I was told that Styles was a good way to do what I wanted to do so
>> I
>> decided to use Styles
>> I had no experience and very little understanding of either Styles or
>> Conditional Formatting.  I assumed Styles was easier to learn and use.  I
>> now have decided to learn and use Conditional Formatting instead of
>> Styles.
>> I am starting by checking the OOo website to see what information is
>> available.
>>
>> Walter
>>
>> On Mon, Nov 9, 2009 at 2:49 AM, Harold Fuchs <
>> hwfa.openoffice@...
>>
>>
>>> wrote:
>>>
>>>
>>
>>
>>
>>> 2009/11/9 Harold Fuchs <hwfa.openoffice@...>
>>>
>>>
>>>
>>>> 2009/11/9 Walter Hildebrandt <wh2468@...>
>>>>
>>>> What does 0 mean and what is its effect in various condition?
>>>>      In a numeric context, 0 means zero.
>>>> If you try to treat *text* in a numeric context then the text will
>>>>
>>>>
>>> usually
>>>
>>>
>>>> be treated as zero.
>>>>
>>>>
>>>>
>>>>
>>>>>  For example : When I got the formula
>>>>>
>>>>>
>>>> =A1-40+IF(A1>40;STYLE("RedText");0),
>>>
>>>
>>>> I
>>>>> was told “The STYLE function always returns 0, so the formula is
>>>>> mathematically
>>>>> equal to A1-40+0”
>>>>>
>>>>>
>>>> Correct. I don't know where you got that formula but it doesn't do
>>>>
>>>>
>>> anything
>>>
>>>
>>>> useful. See below.
>>>>
>>>>
>>>>
>>>>
>>>>> What is effect of the 0 at the end of the formula?
>>>>>
>>>>>
>>>>>
>>>> The syntax of an IF consists of three components:
>>>>
>>>>   1. the condition
>>>>   2. what to do if the condition is true
>>>>   3. what to do if the condition is false
>>>>
>>>> These are separated by semicolons. Thus your IF, which is
>>>>
>>>>    IF(A1>40;STYLE("RedText");0)
>>>> says
>>>>   if the contents of cell A1 is greater than 40  [#1, the condition]
>>>>      set the current cell's value to STYLE("RedText")   [#2, what to do
>>>>
>>>>
>>> if
>>>
>>>
>>>> the condition is true]
>>>>   otherwise set the current cell's value to zero    [#3, what to do if
>>>>
>>>>
>>> the
>>>
>>>
>>>> condition is false]
>>>>
>>>> However, all this is nonsense. Calc's Help on the Style function tells
>>>> us
>>>> that its syntax is nothing like the one you cited and that it doesn't do
>>>> anything like what you've been told. I quote:
>>>>
>>>> ======== begin quote ====
>>>> Syntax
>>>>
>>>> STYLE(style;time;style2)
>>>>
>>>> Style is the name of a cell style assigned to the cell. Style names must
>>>>
>>>>
>>> be
>>>
>>>
>>>> entered in quotation marks.
>>>>
>>>> Time is an optional time range in seconds. If this parameter is missing
>>>>
>>>>
>>> the
>>>
>>>
>>>> style will not be changed after a certain amount of time has passed.
>>>>
>>>> Style2 is the optional name of a cell style assigned to the cell after a
>>>> certain amount of time has passed. If this parameter is missing
>>>>
>>>>
>>> "Standard"
>>>
>>>
>>>> is assumed.
>>>>
>>>> ===end quote ===
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>  For example if “Negative numbers red” is selected (is checked) when
>>>>> formatting cells, 0:[RED]-0 appears in the Format code box.
>>>>>
>>>>>  For example I was told “Enter something like this in the format code
>>>>> field:
>>>>> 0"%" This will just add the % character right after the number, but the
>>>>> number will still act as an ordinary number.”
>>>>>
>>>>>
>>>>>
>>>> "Something like" is probably true depending on your definition of the
>>>> phrase. A dog is something like a horse, perhaps: 4 legs, tail, hair,
>>>>
>>>>
>>> friend
>>>
>>>
>>>> of mankind. But ...
>>>>
>>>>
>>>>
>>>>
>>>>>  Also when entering the O, under different conditions, Is the 0 a zero
>>>>>
>>>>>
>>>> or
>>>
>>>
>>>> a
>>>>> capital letter?
>>>>>
>>>>>
>>>>>
>>>> usually zero. A bare (unquoted) letter O would normally only be
>>>>
>>>>
>>> meaningful
>>>
>>>
>>>> if you had *named* something (like a print-range) "O".
>>>>
>>>> Why don't you use the Conditional Formatting menu to do what you want?
>>>>
>>>>
>>>> Sorry to reply to my own post but I've done some more research.
>>>>
>>>>
>>> If you have your values in column A, then you can set column B to your
>>> desired colours (and values) by putting in B1 the formula
>>>  =A1+STYLE(IF(CURRENT()>40; "Red"; IF(CURRENT()<40;"Green";"Default")))
>>> and dragging it down the column.
>>>
>>> This will set column B to have the same *values* as column A but with the
>>> appropriate colours.
>>>
>>> You are *adding* ("+") the value of the Style function, which is always
>>> zero. But the function has the *side effect* of setting the style. Note
>>> that
>>> the If is "inside" the Style, not vice versa as you had it.
>>>
>>> The If looks complicated but isn't. It's just the normal 3 parts
>>> separated
>>> by semicolons. The interesting bit is that the third part of the first If
>>> is
>>> another If, which has the usual 3 parts. Just read it carefully.
>>>
>>>
>>> --
>>> Harold Fuchs
>>> London, England
>>> Please reply *only* to users@...
>>>
>>>
>>>
>>
>>
>>
> See my second post (above). Brian Barker told you, in a different thread of
> yours on this same subject "But using STYLE(IF()) instead of IF(STYLE())
> appears to solve the problem". This is the same as my comment above: "Note
> that the If is "inside" the Style, not vice versa as you had it."
>
> Now that you have the correct syntax, using styles is the way to go as they
> are more generally useful throughout OOo, not just in Calc.
>
> --
> Harold Fuchs
> London, England
> Please reply *only* to users@...
>
>