Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Help with Conditional Formatting

I am working with a large list in Excel 2003. One column is formatted as
general. Each cell in the column has numbers in it that look like this:
1234-1234. I want to have the cell turn red if there are not nine characters
in it.

I have selected conditinal formatting for the cell. I use fomula
=if(len(B4)<9) and tell it to make the cell red. It doesn't work. Can anyone
help me figure out why?

Thanks for any help given.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Help with Conditional Formatting

Conditional formats want functions that return true of false. To that end you
do not need the if function. Try this formula

=len(b4)<9

as it will return true or false
--
HTH...

Jim Thomlinson


"RM270" wrote:

I am working with a large list in Excel 2003. One column is formatted as
general. Each cell in the column has numbers in it that look like this:
1234-1234. I want to have the cell turn red if there are not nine characters
in it.

I have selected conditinal formatting for the cell. I use fomula
=if(len(B4)<9) and tell it to make the cell red. It doesn't work. Can anyone
help me figure out why?

Thanks for any help given.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Help with Conditional Formatting

Thanks Jim! Works perfectly! But I forgot about empty cells. I don't want
them to turn a color if len=0. Should I make two conditions to cover that?
Does it matter which one come first?

"Jim Thomlinson" wrote:

Conditional formats want functions that return true of false. To that end you
do not need the if function. Try this formula

=len(b4)<9

as it will return true or false
--
HTH...

Jim Thomlinson


"RM270" wrote:

I am working with a large list in Excel 2003. One column is formatted as
general. Each cell in the column has numbers in it that look like this:
1234-1234. I want to have the cell turn red if there are not nine characters
in it.

I have selected conditinal formatting for the cell. I use fomula
=if(len(B4)<9) and tell it to make the cell red. It doesn't work. Can anyone
help me figure out why?

Thanks for any help given.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default Help with Conditional Formatting

=and(len(b4)<9, len(b4)0)

so if B4 has more than 1 character but not 9 characters then the formula
returns true and the colour is applied... I think that is what you wanted...

In CF's it definilty matters which order you apply the formats as formats
are applied in order and once a format has been applied it does not evaluate
any further formats. So if you had cirteria 1 =len(b4)<9 then it would not
get to your second criteria if the len was 0 as the firrts conditoin is true.
You would have to have the formats in the other order.
--
HTH...

Jim Thomlinson


"RM270" wrote:

Thanks Jim! Works perfectly! But I forgot about empty cells. I don't want
them to turn a color if len=0. Should I make two conditions to cover that?
Does it matter which one come first?

"Jim Thomlinson" wrote:

Conditional formats want functions that return true of false. To that end you
do not need the if function. Try this formula

=len(b4)<9

as it will return true or false
--
HTH...

Jim Thomlinson


"RM270" wrote:

I am working with a large list in Excel 2003. One column is formatted as
general. Each cell in the column has numbers in it that look like this:
1234-1234. I want to have the cell turn red if there are not nine characters
in it.

I have selected conditinal formatting for the cell. I use fomula
=if(len(B4)<9) and tell it to make the cell red. It doesn't work. Can anyone
help me figure out why?

Thanks for any help given.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Help with Conditional Formatting

Do it in one condition.

=AND(LEN(B4)<9,NOT(ISBLANK(B4)))


Gord Dibben MS Excel MVP

On Fri, 19 Feb 2010 08:15:01 -0800, RM270
wrote:

Thanks Jim! Works perfectly! But I forgot about empty cells. I don't want
them to turn a color if len=0. Should I make two conditions to cover that?
Does it matter which one come first?

"Jim Thomlinson" wrote:

Conditional formats want functions that return true of false. To that end you
do not need the if function. Try this formula

=len(b4)<9

as it will return true or false
--
HTH...

Jim Thomlinson


"RM270" wrote:

I am working with a large list in Excel 2003. One column is formatted as
general. Each cell in the column has numbers in it that look like this:
1234-1234. I want to have the cell turn red if there are not nine characters
in it.

I have selected conditinal formatting for the cell. I use fomula
=if(len(B4)<9) and tell it to make the cell red. It doesn't work. Can anyone
help me figure out why?

Thanks for any help given.




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Help with Conditional Formatting

Thank you! It does just what I want it to do! And thanks for explaining how
it works. That helps a whole lot.

"Jim Thomlinson" wrote:

=and(len(b4)<9, len(b4)0)

so if B4 has more than 1 character but not 9 characters then the formula
returns true and the colour is applied... I think that is what you wanted...

In CF's it definilty matters which order you apply the formats as formats
are applied in order and once a format has been applied it does not evaluate
any further formats. So if you had cirteria 1 =len(b4)<9 then it would not
get to your second criteria if the len was 0 as the firrts conditoin is true.
You would have to have the formats in the other order.
--
HTH...

Jim Thomlinson


"RM270" wrote:

Thanks Jim! Works perfectly! But I forgot about empty cells. I don't want
them to turn a color if len=0. Should I make two conditions to cover that?
Does it matter which one come first?

"Jim Thomlinson" wrote:

Conditional formats want functions that return true of false. To that end you
do not need the if function. Try this formula

=len(b4)<9

as it will return true or false
--
HTH...

Jim Thomlinson


"RM270" wrote:

I am working with a large list in Excel 2003. One column is formatted as
general. Each cell in the column has numbers in it that look like this:
1234-1234. I want to have the cell turn red if there are not nine characters
in it.

I have selected conditinal formatting for the cell. I use fomula
=if(len(B4)<9) and tell it to make the cell red. It doesn't work. Can anyone
help me figure out why?

Thanks for any help given.

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
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 3 January 20th 07 02:02 PM
conditional Formatting based on cell formatting Totom Excel Worksheet Functions 0 January 15th 07 04:35 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM


All times are GMT +1. The time now is 09:39 AM.

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"