Formula to extract data from a list without blank space and sort it with the earliest date.

woah

New Member
Joined
May 10, 2023
Messages
24
Office Version
  1. 2016
Platform
  1. Windows
Hi there,

I would like to extract the data from the list of period ("Column F") without the blank space, and sort it with the earliest date. Here is the example. I want it to come out with the result like cell F4 and F5.

What formula can I use for this case? Thank you very much


Time.png
 
Yes, it could be.
Thanks.
I have also used a helper column (H) which could be hidden. See if this is headed in the right direction.

23 05 11.xlsm
EFGH
4Time 115/4/2023 - 30/4/2023
5Time 215/4/2023 - 21/5/2023
6Time 322/5/2023 - 4/6/2023
7Time 45/6/2023 - 10/6/2023
8Time 5 
9
10
1122/5/2023 - 4/6/202322/05/2023
12 
13 
1415/4/2023 - 30/4/202315/04/2023
15 
16 
175/6/2023 - 10/6/20235/06/2023
18 
19 
20 
21 
22 
2315/4/2023 - 21/5/202315/04/2023
24 
25 
Extract List
Cell Formulas
RangeFormula
F4:F8F4=IFERROR(INDEX(F$11:F$100,AGGREGATE(15,6,(ROW(F$11:F$100)-ROW(F$11)+1)/(H$11:H$100=SMALL(H$11:H$100,ROWS(F$4:F4))),COUNTIF(F$3:F3,TEXT(SMALL(H$11:H$100,ROWS(F$4:F4)),"d/m/yyyy")&"*")+1)),"")
H11:H25H11=IF(F11="","",LEFT(F11,FIND(" ",F11))+0)
 
Upvote 0

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).
If the above result is satisfactory for you then it probably makes more sense to use two helper columns and keep the formulas a bit simpler.

23 05 11.xlsm
EFGHI
4Time 115/4/2023 - 30/4/2023
5Time 215/4/2023 - 21/5/2023
6Time 322/5/2023 - 4/6/2023
7Time 45/6/2023 - 10/6/2023
8Time 5 
9
10
1122/5/2023 - 4/6/202322/05/20233
12  
13  
1415/4/2023 - 30/4/202315/04/20231
15  
16  
175/6/2023 - 10/6/20235/06/20234
18  
19  
20  
21  
22  
2315/4/2023 - 21/5/202315/04/20232
24  
25  
Extract List (2)
Cell Formulas
RangeFormula
F4:F8F4=IFNA(INDEX(F$11:F$100,MATCH(ROWS(F$4:F4),I$11:I$100,0)),"")
H11:H25H11=IF(F11="","",LEFT(F11,FIND(" ",F11))+0)
I11:I25I11=IF(H11="","",RANK(H11,H$11:H$100,1)+COUNTIF(H$10:H10,H11))
 
Upvote 0
Thank you. However, if some of the data might the same start date but with different end date, or vice versa. Your formula won't work.

Just like this list.

View attachment 91417

OK. My formula doesn't work with duplicate data, because you hadn't mentioned it.

I give you another option, this option uses 3 helper columns and also checks if you have the same duplicate date range, you didn't mention it, but now I consider it too.

Dante Amor
EFGHI
4Time 115/4/2023 - 30/4/2023
5Time 215/4/2023 - 21/5/2023
6Time 322/5/2023 - 31/5/2023
7Time 422/5/2023 - 31/5/2023
8Time 522/5/2023 - 4/6/2023
9
10
1122/5/2023 - 4/6/202322/05/202304/06/20235.011
12   
1315/4/2023 - 21/5/202315/04/202321/05/20232.013
14   
155/6/2023 - 10/6/202305/06/202310/06/20236.015
16   
1715/4/2023 - 30/4/202315/04/202330/04/20231.017
18   
1922/5/2023 - 31/5/202322/05/202331/05/20233.019
20 
2122/5/2023 - 31/5/202322/05/202331/05/20233.021
22
Hoja8 (3)
Cell Formulas
RangeFormula
F4:F8F4=INDEX($F$11:$F$100,SUMPRODUCT(($I$11:$I$100=SMALL($I$11:$I$100,ROWS($E$4:E4)))*ROW($I$11:$I$100))-ROW($F$11)+1)
G21,G11:G19G11=IF(F11="","",LEFT(F11,FIND("-",F11)-2)+0)
H21,H11:H19H11=IF(F11="","",MID(F11,FIND("-",F11)+2,10)+0)
I11:I21I11=IF(G11="","",COUNTIF($G$11:$G$100,"<"&G11)+COUNTIFS($G$11:$G$100,G11,$H$11:$H$100,"<"&H11)+1+ROW()/1000)


I hope it helps you. Have a great day. :cool:
 
Upvote 0

Forum statistics

Threads
1,215,237
Messages
6,123,800
Members
449,127
Latest member
Cyko

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