OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Combine change of style and retrieval of currency value

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
theraja
Newbie
Newbie


Joined: 30 Aug 2009
Posts: 2
Location: Pittsburgh, PA

PostPosted: Sun Aug 30, 2009 11:38 am    Post subject: Combine change of style and retrieval of currency value Reply with quote

Hi there, Very Happy

basically, what I want to do is this: If the letter in D4 is "Y" then cell G4 shall change style to style "yellow cell" and also retrieve the currency value to be found in B4.

This is what I tried:

=IF(D4="Y";B4;0) & STYLE(IF(D4="Y";"Yellow Cell";"Default"))

It works at least somewhat as G4 does turn yellow (as my defined style has it) and it also does take something quite similar to the value given in B4. Strangely, though, to the right of that value an additional zero appears (which does not make sense as it changes the value) and although the Default style is defined as having a currency value (EUR), the string referring to the currency, i. e. "EUR", does not show. Also, it is not possible to use the SUM function in some other cell, say, B5, on whatever appears in G4. Shocked

When I exchange the arguments in the &-function, such as to get

=STYLE(IF(D4="Y";"Yellow Cell";"Default")) & IF(D4="Y";B4;0)

the additional zero will now appear to the left of the value retrieved from B4. Again, the string referring to the currency, i. e. "EUR", does not show and it is also, again, not possible to use the SUM function in some other cell, say, B5, on whatever appears in G4. Rolling Eyes

My best guess is that somehow the '&' does something that I do not intend.

I also tried to use only one IF-function:

=STYLE(IF(D4="Y";"Yellow Cell" & B4;"Default"))

Yet that doesn't seem to work either, as I think that the STYLE-function cannot be used that way... I do get an error message. Sad

So I am, after all, clueless as to what else to do. Any help will be happily appreciated! Very Happy
Back to top
View user's profile Send private message
theraja
Newbie
Newbie


Joined: 30 Aug 2009
Posts: 2
Location: Pittsburgh, PA

PostPosted: Sun Aug 30, 2009 3:54 pm    Post subject: Problem solved! Reply with quote

Got help in the community forum... this is the solution:

=IF(D4="Y";B4+STYLE("Yellow");T(STYLE("Default")))

Thx again, FJCC! Mr. Green
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group