View Single Post
  #5  
Old March 30th, 2010, 04:38 PM posted to microsoft.public.excel.newusers
T. Valko
external usenet poster
 
Posts: 15,759
Default If Statement - Returning Quarter based on Specific Date

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Jamie" wrote in message
...
This works perfectly now and explained the reason for some of the results.
Thanks!!

"T. Valko" wrote:

=IF(AND(G1512/31/09,G154/1/10),"1Q","Continue")


Your dates aren't being evaluated as dates. They're being evaluated as
the
math operation:

12 divided by 31 divided by 9 = 0.043010752688172
4 divided by 1 divided by 10 = 0.4

So, if G15 = the date 1/21/2010 then:

AND(G1512/31/09,G154/1/10)

Will *never* be TRUE.

Use cells to hold the dates:

A1 = 12/31/2009
B1 = 4/1/2010

=IF(AND(G15A1,G15B1),"1Q","Continue")

--
Biff
Microsoft Excel MVP


"Jamie" wrote in message
...
Am using the following formula to determine which quarter a payment was
made.
The first statement returns true, however, the second returns false and
the
date is 1/21/10.
=IF(AND(G1512/31/09,G154/1/10),"1Q","Continue")
Thanks!



.