Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 313
Default If Statement - Date Calculations

I have an IF statement that uses dates to determine which value is displayed
in a cell. I am confused as to whether or not to use quotes (" ") in the
formula. With the quotes it works and without the quotes it doesn't work.
Also, if I change the dates and they are greater than 1/1/2002, the second
formula doesn't work.

Here is the formula:
=IF(AND($A$1<"1/1/2002",$A$31999,$B$1<"1/1/2002",$A$31999),"Monthly","None")

=IF(AND($A$1"12/31/1999",$A$31999,$B$1"12/31/1999",$A$31999),"Monthly","None")


Col A
Col B
Row 1 1/1/1993 1/1/1992
Row 2 $153,564.00
$38,595.00
Row 3 $10,000.00 $2,000.00

If I change the dates to greater than 12/31/2001 than the formula doesn't
work
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,440
Default If Statement - Date Calculations

1. Use complete dates, like 12/31/1999, not just a year, like 1999.
2. It is easier to put each of the dates to compare with (1/1/2002 etc) as date in a cell and compare to that cell, like
=IF(AND($A$1<C1, etc

--
Kind regards,

Niek Otten
Microsoft MVP - Excel


"Tony" wrote in message ...
|I have an IF statement that uses dates to determine which value is displayed
| in a cell. I am confused as to whether or not to use quotes (" ") in the
| formula. With the quotes it works and without the quotes it doesn't work.
| Also, if I change the dates and they are greater than 1/1/2002, the second
| formula doesn't work.
|
| Here is the formula:
| =IF(AND($A$1<"1/1/2002",$A$31999,$B$1<"1/1/2002",$A$31999),"Monthly","None")
|
| =IF(AND($A$1"12/31/1999",$A$31999,$B$1"12/31/1999",$A$31999),"Monthly","None")
|
|
| Col A
| Col B
| Row 1 1/1/1993 1/1/1992
| Row 2 $153,564.00
| $38,595.00
| Row 3 $10,000.00 $2,000.00
|
| If I change the dates to greater than 12/31/2001 than the formula doesn't
| work


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default If Statement - Date Calculations

for your first question
Not using quotes in 12/31/1999 will result in 0,000193645. (12 divided
by 31 divided by 1999) With quotes it is a date

$B$112/31/1999
is equal to
$B$10,000193645

$B$1"12/31/1999"
is equal to the date

|I have an IF statement that uses dates to determine which value is displayed
| in a cell. I am confused as to whether or not to use quotes (" ") in the
| formula. With the quotes it works and without the quotes it doesn't work.
| Also, if I change the dates and they are greater than 1/1/2002, the second
| formula doesn't work.
|
| Here is the formula:
| =IF(AND($A$1<"1/1/2002",$A$31999,$B$1<"1/1/2002",$A$31999),"Monthly","None")
|
| =IF(AND($A$1"12/31/1999",$A$31999,$B$1"12/31/1999",$A$31999),"Monthly","None")
|

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default If Statement - Date Calculations

Hi Tony,

First what dates are you changing - the ones in the formulas or the ones in
cells A1:B1?

If you are changing the formula dates - they work fine for me! If the date
are not greater than 12/31/1999 then they are not greater than 12/31/2001.

Next point - you are testing A31999 twice in each formula, that doesn't
effect the result it's just not necessary.
--
Thanks,
Shane Devenshire


"Tony" wrote:

I have an IF statement that uses dates to determine which value is displayed
in a cell. I am confused as to whether or not to use quotes (" ") in the
formula. With the quotes it works and without the quotes it doesn't work.
Also, if I change the dates and they are greater than 1/1/2002, the second
formula doesn't work.

Here is the formula:
=IF(AND($A$1<"1/1/2002",$A$31999,$B$1<"1/1/2002",$A$31999),"Monthly","None")

=IF(AND($A$1"12/31/1999",$A$31999,$B$1"12/31/1999",$A$31999),"Monthly","None")


Col A
Col B
Row 1 1/1/1993 1/1/1992
Row 2 $153,564.00
$38,595.00
Row 3 $10,000.00 $2,000.00

If I change the dates to greater than 12/31/2001 than the formula doesn't
work

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
If Statement - Date Calculations Tony Excel Discussion (Misc queries) 1 February 5th 08 09:13 PM
Date Calculations before date entered Ma2Weir Excel Discussion (Misc queries) 8 February 1st 07 03:34 AM
Date calculations and sum MIchel Khennafi Excel Worksheet Functions 0 May 10th 06 09:32 PM
date calculations kraway Excel Discussion (Misc queries) 1 January 11th 06 01:57 PM
Date Calculations Bruce Excel Worksheet Functions 11 May 19th 05 01:09 AM


All times are GMT +1. The time now is 02:41 PM.

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"