Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default Conditional formula date

On Tue, 25 Oct 2005 05:07:02 -0500, tghcogo
wrote:


Hi there I want to apply a conditional format to a cell to see if a date
is present.

eg if there is a comment like "SEE JUNE" it becomes red text, otherwise
the date format in the cell remains as it

I'm sure there is a much simpler way to do it than what I am currently
attempting.

TGHC


It seems your definition of a "date" may not be the same as Excel's definition.

Excel stores dates as serial numbers beginning with 1/1/1900 (or 1/1/1904) and
can display them in various formats.

If you want text RED if a comment 'like' "SEE JUNE" is present, you will have
to PRECISELY define what you mean by 'like'.

If you define it as the name of a month being present, in TEXT format without a
date, AND always the last word in the phrase, you could use these 2 CF
functions:

Condition 1
Formula Is:
=NOT(ISERROR(DATEVALUE("1 "&MID(A1,FIND(CHAR(1),SUBSTITUTE(A1,"
",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))+1,255))))

Condition 2
Formula Is:
=NOT(ISERROR(DATEVALUE("1 "&A1)))

You can't combine these two formulas with a single OR statement as you run into
the seven function nesting limit of Excel.

If your phrase will always be at least two words, then the second formula is
not required.

Note that misspellings of the month will not be interpreted as a month.

If your possibilities are more complex, then so will be the solution.


--ron
  #2   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default Conditional formula date

On Tue, 25 Oct 2005 08:56:23 -0400, Ron Rosenfeld
wrote:

On Tue, 25 Oct 2005 05:07:02 -0500, tghcogo
wrote:


Hi there I want to apply a conditional format to a cell to see if a date
is present.

eg if there is a comment like "SEE JUNE" it becomes red text, otherwise
the date format in the cell remains as it

I'm sure there is a much simpler way to do it than what I am currently
attempting.

TGHC


It seems your definition of a "date" may not be the same as Excel's definition.

Excel stores dates as serial numbers beginning with 1/1/1900 (or 1/1/1904) and
can display them in various formats.

If you want text RED if a comment 'like' "SEE JUNE" is present, you will have
to PRECISELY define what you mean by 'like'.

If you define it as the name of a month being present, in TEXT format without a
date, AND always the last word in the phrase, you could use these 2 CF
functions:

Condition 1
Formula Is:
=NOT(ISERROR(DATEVALUE("1 "&MID(A1,FIND(CHAR(1),SUBSTITUTE(A1,"
",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))+1,255))))

Condition 2
Formula Is:
=NOT(ISERROR(DATEVALUE("1 "&A1)))

You can't combine these two formulas with a single OR statement as you run into
the seven function nesting limit of Excel.

If your phrase will always be at least two words, then the second formula is
not required.

Note that misspellings of the month will not be interpreted as a month.

If your possibilities are more complex, then so will be the solution.


--ron



Correction:

Those formulas will pick up a month name anyplace in the string; it does not
have to be last.


--ron
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
Can a date be used for conditional formatting? Stevie P Excel Worksheet Functions 2 September 27th 05 09:42 PM
Formula Help (Date) Chance224 Excel Discussion (Misc queries) 3 August 23rd 05 09:35 PM
excel formula counting date to date in 4 columns stuie d Excel Worksheet Functions 1 May 4th 05 12:46 PM
conditional formula to recognize day of the week from date tiw Excel Discussion (Misc queries) 4 April 20th 05 06:19 PM
Formula for date function Markitos Excel Worksheet Functions 15 November 10th 04 02:05 AM


All times are GMT +1. The time now is 06:05 PM.

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

About Us

"It's about Microsoft Excel"