View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
joeu2004[_2_] joeu2004[_2_] is offline
external usenet poster
 
Posts: 829
Default IF this cell is between 2/1/2015-2/28/15, then do something

"Claus Busch" wrote:
Am Thu, 19 Feb 2015 17:50:04 +0000 schrieb David Zman:
What is the conditional formula for a date driven statement?


=IF(AND(A1=DATEVALUE("01.02.2015"),A1<=DATEVALUE( "28.02.2015")),Your
Formula,"")


Claus's example demonstrates why it is ill-advised to use DATEVALUE: the
form of string depends on regional differences. Claus writes dates as
dd.mm.yyyy, whereas the Subject indicates that David writes mm/dd/yyyy.

Better.... If your unconditional formula would be =B1+C1 and your date is
in A1, write:

=IF(AND(DATE(2015,2,1)<=A1,A1<=DATE(2015,2,28)), B1+C1, "")
or
=IF(MONTH(A1)=2, B1+C1, "")

Use the latter if the date range is always a full calendar month, as your
example is.