Extract data based on date

Ahlis1979

New Member
Joined
May 22, 2017
Messages
15
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi,

Is there a good formula that could do this:

Book1
ABCDEFGHIJKLMNOPQR
1Today:2021-09-15
2Date should be sorted by oldest to newest
3Criteria: Is the date older then today, then it shouldn't show that date in the result view.
4It should only show the 15 oldest that are later or equal today().
5Add dates hereResultResult I want to get
6IDDate StartDate EndTaskNameStatusDate StartDate EndTaskNameDate StartDate EndTaskName
712021-09-142021-09-14Test 1AdamTo old12021-09-142021-09-14Test 1Adam12021-09-152021-09-17Test 3Maria
822021-09-162021-09-15Test 2LucasThis week22021-09-152021-09-17Test 3Maria22021-09-162021-09-15Test 2Lucas
932021-09-152021-09-17Test 3MariaToday32021-09-162021-09-15Test 2Lucas32021-09-202021-09-24Test 4Edward
1042021-09-202021-09-24Test 4EdwardNext week42021-09-202021-09-24Test 4Edward42021-10-012021-10-01Test 5Alice
1152021-10-012021-10-01Test 5AliceFuture52021-10-012021-10-01Test 5Alice5 
1266 6 
1377 7 
1488 8 
1599 9 
161010 10 
171111 11 
181212 12 
191313 13 
201414 14 
211515 15 
2216
2317
2418
2519
2620
2721
2822
2923
3024
3125
3226
3327
3428
3529
3630
Sheet3
Cell Formulas
RangeFormula
C1C1=TODAY()
J7:J21J7=IFERROR(INDEX($C$7:$C$21,MATCH(SMALL($B$7:$B$36,ROW(A1:A15)),$B$7:$B$36,0),1),"")
K7:K21K7=IFERROR(INDEX($D$7:$D$21,MATCH(SMALL($B$7:$B$36,ROW(B1:B15)),$B$7:$B$36,0),1),"")
L7:L21L7=IFERROR(INDEX($E$7:$E$21,MATCH(SMALL($B$7:$B$36,ROW(C1:C15)),$B$7:$B$36,0),1),"")
F7:F11F7=IF(B7<TODAY(),"To old",IF(B7=TODAY(),"Today",IF(AND(B7>=TODAY()-WEEKDAY(TODAY(),2)+1,B7<=TODAY()-WEEKDAY(TODAY())+6),"This week",IF(AND(B7>=TODAY()-WEEKDAY(TODAY(),2)+8,B7<=TODAY()-WEEKDAY(TODAY())+13),"Next week",IF(B7>TODAY()-WEEKDAY(TODAY())+13,"Future","")))))
I7:I21I7=IFERROR(SMALL($B$7:$B$36,H7),"")
O7:O21O7=IFERROR(SMALL($B$7:$B$36,N8),"")
Dynamic array formulas.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
How about
+Fluff 1.xlsm
ABCDEFGHIJKL
1Today:15/09/2021
2
3
4
5Add dates hereResult
6IDDate StartDate EndTaskNameStatusDate StartDate EndTaskName
7114/09/202114/09/2021Test 1AdamTo old115/09/202117/09/2021Test 3Maria
8216/09/202115/09/2021Test 2LucasThis week216/09/202115/09/2021Test 2Lucas
9315/09/202117/09/2021Test 3MariaToday320/09/202124/09/2021Test 4Edward
10420/09/202124/09/2021Test 4EdwardNext week401/10/202101/10/2021Test 5Alice
11501/10/202101/10/2021Test 5AliceFuture5
1266
1377
1488
1599
161010
171111
181212
191313
201414
211515
2216
2317
2418
2519
2620
2721
2822
2923
3024
3125
3226
3327
3428
3529
3630
Main
Cell Formulas
RangeFormula
C1C1=TODAY()
I7:L10I7=LET(Srt,SORT(FILTER(B7:E36,B7:B36>=C1),1),INDEX(Srt,SEQUENCE(MIN(15,ROWS(Srt))),{1,2,3,4}))
F7:F11F7=IF(B7<TODAY(),"To old",IF(B7=TODAY(),"Today",IF(AND(B7>=TODAY()-WEEKDAY(TODAY(),2)+1,B7<=TODAY()-WEEKDAY(TODAY())+6),"This week",IF(AND(B7>=TODAY()-WEEKDAY(TODAY(),2)+8,B7<=TODAY()-WEEKDAY(TODAY())+13),"Next week",IF(B7>TODAY()-WEEKDAY(TODAY())+13,"Future","")))))
Dynamic array formulas.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,583
Messages
6,120,380
Members
448,955
Latest member
BatCoder

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