Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default If And using dates

I am trying to write a formula so the if the current date NOW() is between
08/01/09 to 09/13/09 then put 200 otherwise put 0. See formula below. It
works when I am referencing a cell with those dates but it won't work if I
type the dates into the formula. Am I writing the dates incorrectly? In
Access I usually put #01/08/09# but I tried that format and it didn't work
either.

My formula:
=IF(AND(NOW()=8/3/9,NOW()<=9/13/9),200,0)

Jen
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default If And using dates

Hi,

Maybe this

=IF(AND(NOW()=DATE(2009,8,1),NOW()<=DATE(2009,9,1 3)),200,0)

Mike

"Newbie and Lost" wrote:

I am trying to write a formula so the if the current date NOW() is between
08/01/09 to 09/13/09 then put 200 otherwise put 0. See formula below. It
works when I am referencing a cell with those dates but it won't work if I
type the dates into the formula. Am I writing the dates incorrectly? In
Access I usually put #01/08/09# but I tried that format and it didn't work
either.

My formula:
=IF(AND(NOW()=8/3/9,NOW()<=9/13/9),200,0)

Jen

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default If And using dates

This worked :) Thanks so much!!

"Mike H" wrote:

Hi,

Maybe this

=IF(AND(NOW()=DATE(2009,8,1),NOW()<=DATE(2009,9,1 3)),200,0)

Mike

"Newbie and Lost" wrote:

I am trying to write a formula so the if the current date NOW() is between
08/01/09 to 09/13/09 then put 200 otherwise put 0. See formula below. It
works when I am referencing a cell with those dates but it won't work if I
type the dates into the formula. Am I writing the dates incorrectly? In
Access I usually put #01/08/09# but I tried that format and it didn't work
either.

My formula:
=IF(AND(NOW()=8/3/9,NOW()<=9/13/9),200,0)

Jen

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default If And using dates

"Mike H" wrote:
=IF(AND(NOW()=DATE(2009,8,1),NOW()<=DATE(2009,9,1 3)),200,0)


Since the OP used NOW(), I suspect this is what she needs:

=IF(AND(NOW()=DATE(2009,8,1),NOW()<DATE(2009,9,14 )),200,0)

Note the change from "<=" to "<" and from 9/13/2009 to 9/14/2009.

Test by replacing NOW() with a cell reference, and enter 9/13/2009 23:59:59
into the cell to simulate the latest NOW() on 9/13/2009.

IMHO, the OP should use TODAY(), not NOW(). Then the intuitive formula
would work as Mike (and the OP) wrote it.


----- original message -----

"Mike H" wrote in message
...
Hi,

Maybe this

=IF(AND(NOW()=DATE(2009,8,1),NOW()<=DATE(2009,9,1 3)),200,0)

Mike

"Newbie and Lost" wrote:

I am trying to write a formula so the if the current date NOW() is
between
08/01/09 to 09/13/09 then put 200 otherwise put 0. See formula below. It
works when I am referencing a cell with those dates but it won't work if
I
type the dates into the formula. Am I writing the dates incorrectly? In
Access I usually put #01/08/09# but I tried that format and it didn't
work
either.

My formula:
=IF(AND(NOW()=8/3/9,NOW()<=9/13/9),200,0)

Jen


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 42
Default If And using dates

hi jen,
in my opinion, your formula should be
=IF(AND(NOW()="08/03/2009",NOW()<="09/13/2009"),200,0)

"Newbie and Lost" wrote:

I am trying to write a formula so the if the current date NOW() is between
08/01/09 to 09/13/09 then put 200 otherwise put 0. See formula below. It
works when I am referencing a cell with those dates but it won't work if I
type the dates into the formula. Am I writing the dates incorrectly? In
Access I usually put #01/08/09# but I tried that format and it didn't work
either.

My formula:
=IF(AND(NOW()=8/3/9,NOW()<=9/13/9),200,0)

Jen



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default If And using dates

=IF(AND(NOW()="08/03/2009",NOW()<="09/13/2009"),200,0)
Your formula FAIL. It returns "0" instead of 200

Try it like this:

=IF(AND(NOW()=--"08/03/2009",NOW()<=--"09/13/2009"),200,0)
or
=(TODAY()=40028)*(TODAY()<=40069)*200




"YESHWANT JOSHI" wrote:

hi jen,
in my opinion, your formula should be
=IF(AND(NOW()="08/03/2009",NOW()<="09/13/2009"),200,0)

"Newbie and Lost" wrote:

I am trying to write a formula so the if the current date NOW() is between
08/01/09 to 09/13/09 then put 200 otherwise put 0. See formula below. It
works when I am referencing a cell with those dates but it won't work if I
type the dates into the formula. Am I writing the dates incorrectly? In
Access I usually put #01/08/09# but I tried that format and it didn't work
either.

My formula:
=IF(AND(NOW()=8/3/9,NOW()<=9/13/9),200,0)

Jen

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default If And using dates

"YESHWANT JOSHI" wrote:
in my opinion, your formula should be
=IF(AND(NOW()="08/03/2009",NOW()<="09/13/2009"),200,0)


Certainly not! If you had tried it yourself today (8/19/2009), it would not
have returned 200 as intended.

Arguably, perhaps you meant:

=IF(AND(NOW()=--"08/03/2009",NOW()<=--"09/13/2009"),200,0)

Note the addition of "--" to convert the date strings to date serial
numbers.

But that is deprecated because the correctness depends on Regional and
Language settings. In particular, the modified formula returns a #VALUE
error for --"09/13/2009" when the Regional and Language date setting is
d/MM/yy. Although that is obviously not the case for the OP, we do not know
if her worksheet might be sent to someone who has a different Regional and
Language setting. For that reason, DATE() is the better choice.

PS: In another posting, I also mentioned the problem with comparing NOW()
<= DATE(2009,9,13). I think the OP shoud use TODAY().


----- original message -----

"YESHWANT JOSHI" wrote in message
...
hi jen,
in my opinion, your formula should be
=IF(AND(NOW()="08/03/2009",NOW()<="09/13/2009"),200,0)

"Newbie and Lost" wrote:

I am trying to write a formula so the if the current date NOW() is
between
08/01/09 to 09/13/09 then put 200 otherwise put 0. See formula below. It
works when I am referencing a cell with those dates but it won't work if
I
type the dates into the formula. Am I writing the dates incorrectly? In
Access I usually put #01/08/09# but I tried that format and it didn't
work
either.

My formula:
=IF(AND(NOW()=8/3/9,NOW()<=9/13/9),200,0)

Jen


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default If And using dates

A little more cryptic than the others...

=200*(ABS(TODAY()-40047.5)<22.5)

--
Rick (MVP - Excel)


"Newbie and Lost" wrote in message
...
I am trying to write a formula so the if the current date NOW() is between
08/01/09 to 09/13/09 then put 200 otherwise put 0. See formula below. It
works when I am referencing a cell with those dates but it won't work if I
type the dates into the formula. Am I writing the dates incorrectly? In
Access I usually put #01/08/09# but I tried that format and it didn't work
either.

My formula:
=IF(AND(NOW()=8/3/9,NOW()<=9/13/9),200,0)

Jen


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
Stop dates from showing as numbers - when formated as dates JR Excel Discussion (Misc queries) 1 October 29th 08 04:38 PM
compare 2 tables of dates to find the preceding dates Babi Excel Worksheet Functions 3 October 28th 08 05:52 AM
how do I sort a column of random dates into Consecutive dates Rob Gibson Excel Worksheet Functions 2 June 12th 07 05:10 AM
Identifying unique dates in a range of cells containing dates... cdavidson Excel Discussion (Misc queries) 4 October 13th 06 03:30 PM
Calculating number of days between two dates that fall between two other dates [email protected] Excel Discussion (Misc queries) 5 October 26th 05 06:18 PM


All times are GMT +1. The time now is 04:50 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"