View Single Post
  #3  
Old March 29th, 2010, 05:59 PM posted to microsoft.public.excel.newusers
Joe User[_2_]
external usenet poster
 
Posts: 757
Default If Statement - Returning Quarter based on Specific Date

"Jamie" wrote:
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")


In that form, 12/31/09 is interpreted as 12 divided by 31 divided by 9, not
a date.

You can write:

=IF(AND(G15--"12/31/09",G15--"4/1/10"),
"1Q","Continue")

But that is consider poor form. It is better to write:

=IF(AND(G15date(2009,12,31),G15date(2010,4,1)),
"1Q","Continue")