theraja Newbie

Joined: 30 Aug 2009 Posts: 2 Location: Pittsburgh, PA
|
Posted: Sun Aug 30, 2009 11:38 am Post subject: Combine change of style and retrieval of currency value |
|
|
Hi there,
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.
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.
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.
So I am, after all, clueless as to what else to do. Any help will be happily appreciated!  |
|