# How to extract data from a column by sorting birth dates' column according to given a date?

I have a sheet on which there are students' birth dates. What I would like to do is to put a number on top of a column, and if any birth date is between the range of today() and today+the number, for them to show up under this column. Something like this: If a name shows up under `tomorrow`, it is not showing up in another category. As I understand to get this data we need to compare those birth dates to `today()` and for example for `tomorrow`:

`````` x = today()+1 AND x != today()
``````

If this request is going to cause too much workload, you can dismiss it. Showing the same name under every category is fine, as long as I get the closest ones so I can keep track of them all the time.

Here is the file of the picture above.

Does this work?

`C2`: `=FILTER(A2:A7, B2:B7 = TODAY())`
`D2`: `=FILTER(A2:A7, B2:B7 = TODAY() + 1)`
`E2`: `=FILTER(A2:A7, B2:B7 >= TODAY() + 2, B2:B7 <= TODAY() + 7)`
`F2`: `=FILTER(A2:A7, B2:B7 >= TODAY() + 8, B2:B7 <= TODAY() + 14)`
`G2`: `=FILTER(A2:A7, B2:B7 >= TODAY() + 15, B2:B7 <= TODAY() + 30)`

I would try this to handle the weeks:

``````c2=if(\$B2=today(),\$A2,"")
d2=if(\$B2=today()+1,\$A2,"")
e2=if(AND(weeknum(\$B2)>=weeknum(today()+7),weeknum(\$B2)<=weeknum(today()+14)),\$A2,"")
f2=if(AND(weeknum(\$B2)>=weeknum(today()+14),weeknum(\$B2)<=weeknum(today()+15)),\$A2,"")
g2==if(AND(weeknum(\$B2)>=weeknum(today()+30),weeknum(\$B2)<=weeknum(today()+30)),\$A2,"")
``````
• Thank you for the response, but, there shouldn't be blank spaces between rows. But, I already got my answer. Thank you for your help, as well. – Cem Sultan Oct 20 '16 at 21:23