ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   autofilter with range of partial dates (https://www.excelbanter.com/excel-programming/324210-autofilter-range-partial-dates.html)

François

autofilter with range of partial dates
 
Hello,
I'm trying to code an autofilter to retrieve the people having there
anniverseray this from today up to 7 days.
Date are organized as yyyy-mm-dd in the column.
I'm not able to set working the autofilter like criteria1 "????-07-16" and
criteria2 < "????-07-23" for ex.

Where is the solution.
Many thnaks to all of you.

Roger Govier

autofilter with range of partial dates
 
Hi Francois

I'm not sure whether you are putting ???? into your criteria or not, but if
you are then autofilter won't work.
Try setting criteria 1 to greater than or equal to 2004-07-16 and criteria 2
to less than or equal to 2004-07-23.

If you do need the data across a range of years, set up a helper column with
a formula =YEAR(A1) (assuming your dates are in column A) and then also
filter on this column for the years required.

--
Regards
Roger Govier
"François" wrote in message
...
Hello,
I'm trying to code an autofilter to retrieve the people having there
anniverseray this from today up to 7 days.
Date are organized as yyyy-mm-dd in the column.
I'm not able to set working the autofilter like criteria1 "????-07-16"
and
criteria2 < "????-07-23" for ex.

Where is the solution.
Many thnaks to all of you.




François

autofilter with range of partial dates
 
Thanks Roger,
Yes the purpose of the yyyy was to cover all the years as for anniversary
only month & days are important.
So autofilter will not work with ???? ?
I assume then that I need to fill a column with only "mm-dd" information to
be able to solve this ?.


"Roger Govier" wrote:

Hi Francois

I'm not sure whether you are putting ???? into your criteria or not, but if
you are then autofilter won't work.
Try setting criteria 1 to greater than or equal to 2004-07-16 and criteria 2
to less than or equal to 2004-07-23.

If you do need the data across a range of years, set up a helper column with
a formula =YEAR(A1) (assuming your dates are in column A) and then also
filter on this column for the years required.

--
Regards
Roger Govier
"François" wrote in message
...
Hello,
I'm trying to code an autofilter to retrieve the people having there
anniverseray this from today up to 7 days.
Date are organized as yyyy-mm-dd in the column.
I'm not able to set working the autofilter like criteria1 "????-07-16"
and
criteria2 < "????-07-23" for ex.

Where is the solution.
Many thnaks to all of you.





Roger Govier

autofilter with range of partial dates
 
Hi Francois

I was only half awake when responding to your original post!!!
I think the best solution would be to use Advanced Filter instead of
Autofilter.

Assuming your dates are in column A, beginning in row 2 and that your data
is only within columns A to E.

In cell F2 =MONTH(A2)=7
In cell G2=DAY(A2)=16
in cell H2=DAY(A2)<=23

Mark your block of data.
Data=Filter=Advanced Filter
Criteria=F1:H2

This will give a filtered list of data between 16th July and 23rd July
regardless of year.

For more instruction on the use of Advanced Filters take a look at Debra
Dalgleih's site
http://www.contextures.com/xladvfilter01.html


--
Regards
Roger Govier
"François" wrote in message
...
Hello,
I'm trying to code an autofilter to retrieve the people having there
anniverseray this from today up to 7 days.
Date are organized as yyyy-mm-dd in the column.
I'm not able to set working the autofilter like criteria1 "????-07-16"
and
criteria2 < "????-07-23" for ex.

Where is the solution.
Many thnaks to all of you.





All times are GMT +1. The time now is 11:44 PM.

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