Using if statement to select dates

HC7531

New Member
Joined
Jul 11, 2011
Messages
8
Good Afternoon:

I am working in MS Office 2010 and I am trying to select all dates from a column of dates that fall within a defined period of time:

September 1st, 2010 to August 31st, 2011.

In a separate column, I simply want to populate the column with the word "yes" once excel has identified whether the dates fall within my timeframe.

I don't expect every row to be populated with a "yes" in my new column as many dates are old.

Clearly, I am having difficulty writing the logive for my request and would be gratefule for any assistance that you can provide.

Much appreciated,

CH:)
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Good Afternoon:

I am working in MS Office 2010 and I am trying to select all dates from a column of dates that fall within a defined period of time:

September 1st, 2010 to August 31st, 2011.

In a separate column, I simply want to populate the column with the word "yes" once excel has identified whether the dates fall within my timeframe.

I don't expect every row to be populated with a "yes" in my new column as many dates are old.

Clearly, I am having difficulty writing the logive for my request and would be gratefule for any assistance that you can provide.

Much appreciated,

CH:)
 
Upvote 0
Good Afternoon:

I am working in MS Office 2010 and I am trying to select all dates from a column of dates that fall within a defined period of time:

September 1st, 2010 to August 31st, 2011.

In a separate column, I simply want to populate the column with the word "yes" once excel has identified whether the dates fall within my timeframe.

I don't expect every row to be populated with a "yes" in my new column as many dates are old.

Clearly, I am having difficulty writing the logive for my request and would be gratefule for any assistance that you can provide.

Much appreciated,

CH:)
Try this...


Use cells to hold the date boundaries:
  • E2 = 9/1/2010
  • F2 = 8/31/2011
Book1
AB
21/9/2002
31/28/2008
45/20/2011Yes
51/11/2004
67/1/2010
76/20/2012
812/2/2014
94/15/2008
102/22/2011Yes
116/9/2014
123/8/2000
1310/28/2014
143/10/2012
156/5/2008
169/18/2007
178/28/2011Yes
182/3/2005
191/4/2014
2010/24/2004
Sheet1

This formula entered in B2 and copied down:

=IF(AND(A2>=E$2,A2<=F$2),"Yes","")
 
Upvote 0
Here's a way to do it without entering dates in two extra cells-
Formula in Cell B2 and drag down:


=IF(AND($A2>=DATE(2010,9,1),$A2<=DATE(2011,8,31)),"Yes","NO")
 
Upvote 0

Forum statistics

Threads
1,224,581
Messages
6,179,668
Members
452,936
Latest member
anamikabhargaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top