need help with dates

M

MicheleY

Dates ??

If date in column b1=mar-07, (which by the way looks like 03-07-2007 on the
command line, even if i format it to mar-07. but looks ok in the cell) so if
date in column b1 is less than a certain date, say, (Mar-08), then type
"expired", otherwise take b2 minus b4 divided by 12 and post it.

Thanks for any help
 
J

JE McGimpsey

MicheleY said:
Dates ??

If date in column b1=mar-07, (which by the way looks like 03-07-2007 on the
command line, even if i format it to mar-07. but looks ok in the cell) so if
date in column b1 is less than a certain date, say, (Mar-08), then type
"expired", otherwise take b2 minus b4 divided by 12 and post it.

Your question is rather ambiguous, so it's hard to be definitive.

Does "Mar-08" refer to sometime in March 2008, or 8 March of some year?
I'll assume the 8th of March of 2007 below.

Note that b1 is a cell reference - the first row of column b. I'm not
sure what "column b1" refers to, so I'll assume cell B1.

And your desired result is also ambiguous - does "b2 minus b4 divided
by 12" refer to

B2 - (B4/12)

in which B4 is divided by 12 then subtracted from B2, or

(B2 - B4)/12

in which the result of B2 - B4 is divided by 12?


Dates are simply integer offsets from a base date, so you can compare
them directly:

=IF(B1<DATE(2007,3,8),"expired",B2-(B4/12))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top