ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   IF this cell is between 2/1/2015-2/28/15, then do something (https://www.excelbanter.com/excel-discussion-misc-queries/450674-if-cell-between-2-1-2015-2-28-15-then-do-something.html)

David Zman

IF this cell is between 2/1/2015-2/28/15, then do something
 
What is the conditional formula for a date driven statement?

Thank you

Claus Busch

IF this cell is between 2/1/2015-2/28/15, then do something
 
Hi,

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,"")


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional

joeu2004[_2_]

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.



All times are GMT +1. The time now is 09:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com