extract dates

doriannjeshi

Board Regular
Joined
Apr 5, 2015
Messages
214
Office Version
  1. 2019
Platform
  1. Windows
Hello,
I have a very long list of dates, 3500 rows in these format:
Jan-00Feb-00Mar-00Apr-00May-00Jun-00
02 21:26 Aqu01 07:48 Pis02 18:03 Ari01 05:01 Tau02 22:24 Can01 15:44 Leo
04 22:09 Pis03 07:38 Ari04 18:25 Tau03 07:14 Gem05 07:00 Leo04 02:34 Vir
06 23:45 Ari05 09:42 Tau06 22:05 Gem05 13:16 Can07 18:35 Vir06 14:59 Lib
09 03:26 Tau07 15:07 Gem09 05:45 Can07 23:10 Leo10 07:09 Lib09 02:45 Sco
11 09:36 Gem09 23:50 Can11 16:38 Leo10 11:24 Vir12 18:41 Sco11 12:05 Sag
13 18:06 Can12 10:49 Leo14 05:04 Vir13 00:01 Lib15 04:07 Sag13 18:31 Cap
16 04:31 Leo14 23:00 Vir16 17:39 Lib15 11:38 Sco17 11:19 Cap15 22:38 Aqu
18 16:27 Vir17 11:36 Lib19 05:34 Sco17 21:38 Sag19 16:30 Aqu18 01:27 Pis
21 05:07 Lib19 23:44 Sco21 16:03 Sag20 05:36 Cap21 20:01 Pis20 03:57 Ari
23 16:54 Sco22 09:53 Sag23 23:57 Cap22 11:05 Aqu23 22:21 Ari22 06:53 Tau
26 01:50 Sag24 16:32 Cap26 04:25 Aqu24 13:59 Pis26 00:20 Tau24 10:52 Gem
28 06:47 Cap26 19:16 Aqu28 05:42 Pis26 15:00 Ari28 03:06 Gem26 16:28 Can
30 08:14 Aqu28 19:05 Pis30 05:13 Ari28 15:34 Tau30 07:55 Can29 00:18 Leo
30 17:30 Gem
Jul-00Aug-00Sep-00Oct-00Nov-00Dec-00
01 10:42 Vir02 19:08 Sco01 13:48 Sag01 05:56 Cap01 23:06 Pis01 08:22 Ari
03 22:59 Lib05 06:00 Sag03 22:27 Cap03 12:03 Aqu04 00:27 Ari03 10:01 Tau
06 11:11 Sco07 13:14 Cap06 02:53 Aqu05 14:22 Pis06 00:25 Tau05 11:27 Gem
08 21:04 Sag09 16:32 Aqu08 03:47 Pis07 14:07 Ari08 00:50 Gem07 14:04 Can
11 03:27 Cap11 17:11 Pis10 03:00 Ari09 13:17 Tau10 03:32 Can09 19:18 Leo
13 06:41 Aqu13 17:09 Ari12 02:45 Tau11 14:02 Gem12 09:48 Leo12 04:03 Vir
15 08:12 Pis15 18:24 Tau14 04:57 Gem13 18:01 Can14 19:47 Vir14 15:48 Lib
17 09:38 Ari17 22:14 Gem16 10:39 Can16 01:53 Leo17 08:08 Lib17 04:33 Sco
19 12:16 Tau20 04:56 Can18 19:38 Leo18 12:51 Vir19 20:48 Sco19 15:53 Sag
21 16:48 Gem22 14:02 Leo21 06:53 Vir21 01:24 Lib22 08:08 Sag22 00:32 Cap
23 23:20 Can25 00:57 Vir23 19:19 Lib23 14:04 Sco24 17:25 Cap24 06:34 Aqu
26 07:49 Leo27 13:12 Lib26 08:06 Sco26 01:50 Sag27 00:30 Aqu26 10:46 Pis
28 18:17 Vir30 02:03 Sco28 20:10 Sag28 11:47 Cap29 05:23 Pis28 14:02 Ari
31 06:29 Lib30 19:01 Aqu30 16:55 Tau


I need to fix the data in a single column

02 21:26 Aqu1/2/1900 21:26Aqu
04 22:09 Pis1/4/1900 3:07Pis
06 23:45 Ari1/6/1900 6:23Ari
09 03:26 Tau1/9/1900 6:23Tau


I am getting this data from a site:
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Try a combination of Vstack and Tocol
Advantage. Do not need to sort the data
Format the Date/Time to your preference
Experiment with more ranges
What years do you require? Do you need all 1900 - 2022?
Challenge how to repeat this ~ 125 times

Column A was created with
=VSTACK(TOCOL(Data!A5:F18,1,1),TOCOL(Data!A20:F34,1,1))


Astrology.xlsm
ABC
111
202 21:26 Aqu02-Jan-00 21:26Aqu
304 22:09 Pis04-Jan-00 22:09Pis
406 23:45 Ari06-Jan-00 23:45Ari
509 03:26 Tau09-Jan-00 03:26Tau
611 09:36 Gem11-Jan-00 09:36Gem
2b
Cell Formulas
RangeFormula
A1:A171A1=VSTACK(TOCOL(Data!A5:F18,1,1),TOCOL(Data!A20:F34,1,1))
B1B1=A1
B2:B6B2=IF(ISNUMBER(A2),A2,INT(B1)-DAY(B1)+LEFT(A2,2)+MID(A2,4,5))
C2:C6C2=IF(ISNUMBER(A2),0,RIGHT(A2,3))
Dynamic array formulas.
 
Upvote 0
Good news
I tried the formula with 5 years of data and it worked fine.
It generated 1041 rows. N.B. one cell in the source data was corrupt and required a minor edit.

Do you need all years from 1900?
To make the formula more concise, you could try naming each range.

=VSTACK(TOCOL(A2:F16,1,1),TOCOL(A17:F31,1,1),TOCOL(A32:F47,1,1),TOCOL(A48:F62,1,1),TOCOL(A63:F78,1,1),TOCOL(A79:F93,1,1),TOCOL(A94:F109,1,1),TOCOL(A110:F124,1,1),TOCOL(A125:F140,1,1),TOCOL(A141:F155,1,1),TOCOL(A156:F171,1,1),TOCOL(A172:F186,1,1))
 
Upvote 0
Did you try naming the ranges?

=VSTACK(TOCOL(r_1,1,1),TOCOL(r_2,1,1),TOCOL(r_3,1,1))

There are examples of reorganizing data on this forum with formulas or with Power Query (Get and Transform Data). There was at least one thread today Dec 2.
" Change row data to one column"
Did you review that thread?
 
Upvote 0
No feedback or answers!
I guess project was completed.
The suggestion worked with at least 11 years of data.
Did you try with data for 10, 15, 20, ... years?
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

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