Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Changing text color within a formula???

I have a formula that displays text and values, and I would like to
format the values so they are red if they are negative.

example: =if(a1<0,red(a1),a1) where the word red is to indicate that I
would like that text to show in red.

Not sure if my description is adequate, but I would be happy to clarify
if required.

Thanks in advance,
cTK

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 618
Default Changing text color within a formula???

You can't change colour with a formula in a cell. You can either use cell
formatting (Format/ Cells) which include options for negative to be red, or
you can use Conditional Formatting (Format/ Conditional Formatting) where
you can specify your own conditions and formats.
--
David Biddulph

"Cortez" wrote in message
oups.com...
I have a formula that displays text and values, and I would like to
format the values so they are red if they are negative.

example: =if(a1<0,red(a1),a1) where the word red is to indicate that I
would like that text to show in red.

Not sure if my description is adequate, but I would be happy to clarify
if required.

Thanks in advance,
cTK



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Changing text color within a formula???

Thanks, if it can't be done, I'll stop trying. Conditional formating
won't cut it for this purpose unfortunately.

David Biddulph wrote:
You can't change colour with a formula in a cell. You can either use cell
formatting (Format/ Cells) which include options for negative to be red, or
you can use Conditional Formatting (Format/ Conditional Formatting) where
you can specify your own conditions and formats.
--
David Biddulph

"Cortez" wrote in message
oups.com...
I have a formula that displays text and values, and I would like to
format the values so they are red if they are negative.

example: =if(a1<0,red(a1),a1) where the word red is to indicate that I
would like that text to show in red.

Not sure if my description is adequate, but I would be happy to clarify
if required.

Thanks in advance,
cTK


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Changing text color within a formula???

But the trick you need is wrapped in the number format of the cell itself...
You can use one of the 'custom' formats to color positve, and negative any
way you prefer.
ie some variant of this: $#,##0_);[Red]($#,##0)

sshankle


"Cortez" wrote:

Thanks, if it can't be done, I'll stop trying. Conditional formating
won't cut it for this purpose unfortunately.

David Biddulph wrote:
You can't change colour with a formula in a cell. You can either use cell
formatting (Format/ Cells) which include options for negative to be red, or
you can use Conditional Formatting (Format/ Conditional Formatting) where
you can specify your own conditions and formats.
--
David Biddulph

"Cortez" wrote in message
oups.com...
I have a formula that displays text and values, and I would like to
format the values so they are red if they are negative.

example: =if(a1<0,red(a1),a1) where the word red is to indicate that I
would like that text to show in red.

Not sure if my description is adequate, but I would be happy to clarify
if required.

Thanks in advance,
cTK



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Changing text color within a formula???

Thanks, great idea. Sadly this option is still not a solution. This
would work for the simple example I gave, but I should have been more
descriptive.

I have a complex formula, and it spits out text that includes text and
numbers. The end result is a sentence where the numeric values need to
be color coded, but the surrounding text doesn't.

A better example is this: ="Leading text " & if(as<0,RED(a1), a1) & "
trailing text"

I'd like to be able to have the text in black, and the value of A1 in
red only when A1 is a negative value. I suspect that this isn't
possible with excel, but your idea will be useful in the future no
doubt.

Thanks,
cTK


sshankle wrote:
But the trick you need is wrapped in the number format of the cell itself...
You can use one of the 'custom' formats to color positve, and negative any
way you prefer.
ie some variant of this: $#,##0_);[Red]($#,##0)

sshankle


"Cortez" wrote:

Thanks, if it can't be done, I'll stop trying. Conditional formating
won't cut it for this purpose unfortunately.

David Biddulph wrote:
You can't change colour with a formula in a cell. You can either use cell
formatting (Format/ Cells) which include options for negative to be red, or
you can use Conditional Formatting (Format/ Conditional Formatting) where
you can specify your own conditions and formats.
--
David Biddulph

"Cortez" wrote in message
oups.com...
I have a formula that displays text and values, and I would like to
format the values so they are red if they are negative.

example: =if(a1<0,red(a1),a1) where the word red is to indicate that I
would like that text to show in red.

Not sure if my description is adequate, but I would be happy to clarify
if required.

Thanks in advance,
cTK






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 390
Default Changing text color within a formula???

In .com, Cortez
spake thusly:

Thanks, if it can't be done, I'll stop trying. Conditional
formating won't cut it for this purpose unfortunately.

David Biddulph wrote:

You can't change colour with a formula in a cell. You can
either use cell formatting (Format/ Cells) which include
options for negative to be red, or you can use Conditional
Formatting (Format/ Conditional Formatting) where you can
specify your own conditions and formats.


You may not have understood part of the implication in
what David had said. You can, indeed, have your negative
numbers be red without using Conditional Formatting. You
just use regular formatting. E.g., look at the 4th choice
(in Excel 2002, anyway) for number formatting. If you
format your cells with that, then negative numbers will
be red and in parentheses. If you choose the second format,
then they'll be red, but sans parens.

You can also use a custom format (not the same as conditional
formatting!) to add a minus sign instead of parens, if you
want.

(This thread is reminding me that I'm disappointed nobody
who might understand these custom format codes better than
I do has yet helped me with my question of last week in
Message-ID: , with the
Subject: Custom accounting format . Oh, well.)

-dman-
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 390
Default Changing text color within a formula???

Ah, your further explanation wasn't there when I posted my
other reply just now. Oh, well.

Still, you can color the numbers in such strings in VBA code.
I can't provide an example, but this week a similar thread
was posted here with example code.

-dman

================================================== ========
In . com, Cortez
spake thusly:

Thanks, great idea. Sadly this option is still not a solution. This
would work for the simple example I gave, but I should have been more
descriptive.

I have a complex formula, and it spits out text that includes text and
numbers. The end result is a sentence where the numeric values need to
be color coded, but the surrounding text doesn't.

A better example is this: ="Leading text " & if(as<0,RED(a1), a1) & "
trailing text"

I'd like to be able to have the text in black, and the value of A1 in
red only when A1 is a negative value. I suspect that this isn't
possible with excel, but your idea will be useful in the future no
doubt.

Thanks,
cTK


sshankle wrote:
But the trick you need is wrapped in the number format of the cell itself...
You can use one of the 'custom' formats to color positve, and negative any
way you prefer.
ie some variant of this: $#,##0_);[Red]($#,##0)

sshankle


"Cortez" wrote:

Thanks, if it can't be done, I'll stop trying. Conditional formating
won't cut it for this purpose unfortunately.

David Biddulph wrote:
You can't change colour with a formula in a cell. You can either use cell
formatting (Format/ Cells) which include options for negative to be red, or
you can use Conditional Formatting (Format/ Conditional Formatting) where
you can specify your own conditions and formats.
--
David Biddulph

"Cortez" wrote in message
oups.com...
I have a formula that displays text and values, and I would like to
format the values so they are red if they are negative.

example: =if(a1<0,red(a1),a1) where the word red is to indicate that I
would like that text to show in red.

Not sure if my description is adequate, but I would be happy to clarify
if required.

Thanks in advance,
cTK

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Changing text color within a formula???

If your text is a constant, you can make it part of the actual format and
have the color displayed with the text.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Cortez" wrote in message
ups.com...
Thanks, great idea. Sadly this option is still not a solution. This
would work for the simple example I gave, but I should have been more
descriptive.

I have a complex formula, and it spits out text that includes text and
numbers. The end result is a sentence where the numeric values need to
be color coded, but the surrounding text doesn't.

A better example is this: ="Leading text " & if(as<0,RED(a1), a1) & "
trailing text"

I'd like to be able to have the text in black, and the value of A1 in
red only when A1 is a negative value. I suspect that this isn't
possible with excel, but your idea will be useful in the future no
doubt.

Thanks,
cTK


sshankle wrote:
But the trick you need is wrapped in the number format of the cell

itself...
You can use one of the 'custom' formats to color positve, and negative

any
way you prefer.
ie some variant of this: $#,##0_);[Red]($#,##0)

sshankle


"Cortez" wrote:

Thanks, if it can't be done, I'll stop trying. Conditional formating
won't cut it for this purpose unfortunately.

David Biddulph wrote:
You can't change colour with a formula in a cell. You can either

use cell
formatting (Format/ Cells) which include options for negative to be

red, or
you can use Conditional Formatting (Format/ Conditional Formatting)

where
you can specify your own conditions and formats.
--
David Biddulph

"Cortez" wrote in message
oups.com...
I have a formula that displays text and values, and I would like to
format the values so they are red if they are negative.

example: =if(a1<0,red(a1),a1) where the word red is to indicate

that I
would like that text to show in red.

Not sure if my description is adequate, but I would be happy to

clarify
if required.

Thanks in advance,
cTK





  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Changing text color within a formula???

The text unfortunately isn't consistent enough to use formatting. I
think I will pursue a VBA solution.

Thanks so much.
cTK


Dallman Ross wrote:
In .com, Cortez
spake thusly:

Thanks, if it can't be done, I'll stop trying. Conditional
formating won't cut it for this purpose unfortunately.

David Biddulph wrote:

You can't change colour with a formula in a cell. You can
either use cell formatting (Format/ Cells) which include
options for negative to be red, or you can use Conditional
Formatting (Format/ Conditional Formatting) where you can
specify your own conditions and formats.


You may not have understood part of the implication in
what David had said. You can, indeed, have your negative
numbers be red without using Conditional Formatting. You
just use regular formatting. E.g., look at the 4th choice
(in Excel 2002, anyway) for number formatting. If you
format your cells with that, then negative numbers will
be red and in parentheses. If you choose the second format,
then they'll be red, but sans parens.

You can also use a custom format (not the same as conditional
formatting!) to add a minus sign instead of parens, if you
want.

(This thread is reminding me that I'm disappointed nobody
who might understand these custom format codes better than
I do has yet helped me with my question of last week in
Message-ID: , with the
Subject: Custom accounting format . Oh, well.)

-dman-


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional formatting based on text within a formula Sarah Jane Excel Worksheet Functions 13 October 12th 06 04:12 PM
Text entries behaving like numbers jkiser Excel Discussion (Misc queries) 12 August 30th 06 09:29 PM
formula bar shows a ' before text Rose Excel Discussion (Misc queries) 4 March 2nd 06 03:26 PM
Invisable text in formula bar Leroy-P Excel Discussion (Misc queries) 2 December 8th 05 02:40 PM
Formulas dealing with text data Bagia Excel Worksheet Functions 6 June 20th 05 10:29 PM


All times are GMT +1. The time now is 08:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"