View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.newusers
Joe User[_2_] Joe User[_2_] is offline
external usenet poster
 
Posts: 905
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,G15<4/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),G15<date(2010,4,1)),
"1Q","Continue")