Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 191
Default If Statement - Returning Quarter based on Specific Date

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")
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default If Statement - Returning Quarter based on Specific Date

=IF(AND(G1512/31/09,G15<4/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,G15<4/1/10)

Will *never* be TRUE.

Use cells to hold the dates:

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

=IF(AND(G15A1,G15<B1),"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,G15<4/1/10),"1Q","Continue")
Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.newusers
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")
  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 191
Default If Statement - Returning Quarter based on Specific Date

This works perfectly now and explained the reason for some of the results.
Thanks!!

"T. Valko" wrote:

=IF(AND(G1512/31/09,G15<4/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,G15<4/1/10)

Will *never* be TRUE.

Use cells to hold the dates:

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

=IF(AND(G15A1,G15<B1),"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,G15<4/1/10),"1Q","Continue")
Thanks!



.

  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
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,G15<4/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,G15<4/1/10)

Will *never* be TRUE.

Use cells to hold the dates:

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

=IF(AND(G15A1,G15<B1),"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,G15<4/1/10),"1Q","Continue")
Thanks!



.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return the current Yearly Quarter based on date hozman Excel Worksheet Functions 2 November 12th 09 11:29 PM
How do I convert a specific date to a fiscal quarter ? RichNYC Excel Discussion (Misc queries) 10 November 26th 07 03:35 PM
Returning Specific Cell Content using IF Statement weeclaire Excel Discussion (Misc queries) 2 February 17th 06 01:48 PM
Returning Specific Cell Content using IF Statement weeclaire Excel Discussion (Misc queries) 0 February 17th 06 09:25 AM
Returning the Week Number of a Specific Date on a Month arjcvg Excel Worksheet Functions 0 November 3rd 04 04:26 AM


All times are GMT +1. The time now is 04:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"