set formatting without using Conditional Formatting

C

Chris T-M

I'm trying to set formatting with a function, and not with conditional
formatting.

=IF(A1>0,A1,B1)

What I want

=IF(A1>0,A1 [font on bold blue],B1 [font in black])

I realize that this could be done with Conditional Formatting, but the
actual function is significantly more complex.

Any solutions or "Can't be done" are welcome.
 
D

Duke Carey

Conditional formatting, manual formatting, or VBA code are your 3 choices.
Formulas alone cannot set formatting attributes.

Oh, there is a 4th choice: using color codes in your numeric formatting
strings, e.g. [red]
 
C

Chris T-M

I'm not sure what you mean by
"...using color codes in your numeric formatting strings, e.g. [red]"
Would you provide a simple code example?


Duke Carey said:
Conditional formatting, manual formatting, or VBA code are your 3 choices.
Formulas alone cannot set formatting attributes.

Oh, there is a 4th choice: using color codes in your numeric formatting
strings, e.g. [red]

Chris T-M said:
I'm trying to set formatting with a function, and not with conditional
formatting.

=IF(A1>0,A1,B1)

What I want

=IF(A1>0,A1 [font on bold blue],B1 [font in black])

I realize that this could be done with Conditional Formatting, but the
actual function is significantly more complex.

Any solutions or "Can't be done" are welcome.
 
S

Spiky

Oh, there is a 4th choice: using color codes in your numeric formatting
strings, e.g. [red]

I thought that didn't work? I could swear I've tried before, and
failed.
 
G

Gord Dibben

See John McGimpsey's site for custom formatting up to 6 colors.

http://www.mcgimpsey.com/excel/conditional6.html


Gord Dibben MS Excel MVP

I'm not sure what you mean by
"...using color codes in your numeric formatting strings, e.g. [red]"
Would you provide a simple code example?


Duke Carey said:
Conditional formatting, manual formatting, or VBA code are your 3 choices.
Formulas alone cannot set formatting attributes.

Oh, there is a 4th choice: using color codes in your numeric formatting
strings, e.g. [red]

Chris T-M said:
I'm trying to set formatting with a function, and not with conditional
formatting.

=IF(A1>0,A1,B1)

What I want

=IF(A1>0,A1 [font on bold blue],B1 [font in black])

I realize that this could be done with Conditional Formatting, but the
actual function is significantly more complex.

Any solutions or "Can't be done" are welcome.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top