Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if function

Status
Not open for further replies.

dmb1

Technical User
Sep 19, 2000
55
GB
Hello,

I have a spreadsheet which contains dates. What I would like is to have an IF function which when the date has passed has a text colour of say 'red' and if the date is still to come has a text colour of say 'blue' but I am unsure how to do this - I am presuming an IF function is the way to go on this though!

Any help would be great.
 
Hi,

if cell is A1

Set Cell Interior Color Blue

Use Format/Conditional Formatting

Formula: =A1<Today()

Format Cell Interior Color Red

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Hi dmb1,

Conditional Formatting is the way to go ..

Select the Cells with the dates
Format them as you want future dates to show
Select Format > Conditional Formatting... from the Menu
Under Condition 1 leave the default of "Cell Value Is"
In the next textbox to the right, change "between" to "less than"
The two textboxes on the right will be replaced by a single one. In here enter [blue]=NOW()[/blue]
Choose the format for past dates and press OK

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Oops, too slow [smile]

Hi Skip!

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
I thought I heard an ECHO...echo...[sub]echo[/sub]

;-)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
You could use conditional formatting comparing the contents of the cell to a cell containing =TODAY()

Regards

Keith
 
he...he...

more echo! ;-)

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
ROFL! rofl!

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top