Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 76
Default Conditional Formating with IF and AND formula

Hello:
I'm trying to apply conditional formatting depending on where the value
falls within a date range.

If cell S2 is < 06/28/09 - color the cell in red
If cell S2 is = 09/28/09 - leave the cell without any color
If cell S2 is = 06/29/09 and <= 09/27/09 color the cell in green.

I've tried to put it into conditional formatting but it changes the color of
every cell to red. Here is what I did, please advise, I think it must
something to do with date...

Formula is =S2<"06/28/09" (format red)
Formula is =S2="09/28/09" (format none)
Formula is =AND(S2="06/29/09",S2<="09/27/09") (format green)

Please help.
Monika
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Conditional Formating with IF and AND formula

Your structure is good, is just the way you refer to dates. As is, XL thinks
6/28/09 is text, and thus can't compare to it.


Formula is =S2<=DATEVALUE("06/28/09") (format red)
Formula is =AND(S2=DATEVALUE("06/29/09"),S2<=DATEVALUE("09/27/09"))
(format green)

Note that there is no need for 2nd formula of "no format".

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"murkaboris" wrote:

Hello:
I'm trying to apply conditional formatting depending on where the value
falls within a date range.

If cell S2 is < 06/28/09 - color the cell in red
If cell S2 is = 09/28/09 - leave the cell without any color
If cell S2 is = 06/29/09 and <= 09/27/09 color the cell in green.

I've tried to put it into conditional formatting but it changes the color of
every cell to red. Here is what I did, please advise, I think it must
something to do with date...

Formula is =S2<"06/28/09" (format red)
Formula is =S2="09/28/09" (format none)
Formula is =AND(S2="06/29/09",S2<="09/27/09") (format green)

Please help.
Monika

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 76
Default Conditional Formating with IF and AND formula

Awesome, awesome, awesome!!!
Thank you, worked like a charm.
Excel is so picky abou the dates :).
Thanks again.
Monika

"Luke M" wrote:

Your structure is good, is just the way you refer to dates. As is, XL thinks
6/28/09 is text, and thus can't compare to it.


Formula is =S2<=DATEVALUE("06/28/09") (format red)
Formula is =AND(S2=DATEVALUE("06/29/09"),S2<=DATEVALUE("09/27/09"))
(format green)

Note that there is no need for 2nd formula of "no format".

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"murkaboris" wrote:

Hello:
I'm trying to apply conditional formatting depending on where the value
falls within a date range.

If cell S2 is < 06/28/09 - color the cell in red
If cell S2 is = 09/28/09 - leave the cell without any color
If cell S2 is = 06/29/09 and <= 09/27/09 color the cell in green.

I've tried to put it into conditional formatting but it changes the color of
every cell to red. Here is what I did, please advise, I think it must
something to do with date...

Formula is =S2<"06/28/09" (format red)
Formula is =S2="09/28/09" (format none)
Formula is =AND(S2="06/29/09",S2<="09/27/09") (format green)

Please help.
Monika

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 FORMATING FORMULA Kanmi Excel Worksheet Functions 6 June 26th 09 05:03 PM
formula for conditional formating jockj215 Excel Discussion (Misc queries) 5 April 29th 09 05:03 PM
Conditional formating formula Jman Excel Worksheet Functions 2 September 20th 08 01:20 AM
if, then formula with conditional formating Rex Excel Worksheet Functions 4 October 23rd 06 05:29 PM
Formula for Conditional Formating - Help! Mark Campbell Excel Worksheet Functions 2 July 26th 06 07:57 AM


All times are GMT +1. The time now is 10:29 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"