View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default Excel If command

You can do this with conditional formatting. Select the cell(s) in
column A (with A1 being the active cell of the selection), then click
on Format | Conditional Formatting. In the first panel of the pop-up
you should select Formula Is rather than Cell Value Is, and then put
this formula in the next panel:

=A1-TODAY()<=30

Click on the Format button, select the Patterns tab (for background
colour) and click on Red. Click OK twice to exit the dialogue boxes.

Any dates which are within 30 days of today's date will be
highlighted.

Hope this helps.

Pete

On Jan 23, 4:11*pm, Fahad Javaid <Fahad
wrote:
hi,
I am finding difficulty in putting the right code in the bar, it was that;
if there is a date ( 30April2008) and the formula is applied in the very
next box of it. that if there are less than 30 days left in the date
specified box then it become red or the wording will become red.

i am not aware of what to do with the color but i was just trying to write
the basic formula first but wasn't successful
=if(a1<=date(0,0,30), red, " ")
but it didn't work out for me