Divide a cell Content

binetht

New Member
Joined
Dec 22, 2020
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a cell which containing date and time as below,

06-10-2020 10:00:0008-10-2020 13:36:0012-10-2020 09:18:0012-10-2020 14:42:00

I want to divided this cell in to 4 separate cells of date and time.

Thanks
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Use
=LEFT(A1,19)*1
=MID(A1,20,19)*1
=MID(A1,39,19)*1
=RIGHT(A1,19)*1

The *1 is to change the text output to a date value, otherwise it will stay as TEXT


Book1
A
106-10-2020 10:00:0008-10-2020 13:36:0012-10-2020 09:18:0012-10-2020 14:42:00
2
310/6/20 10:00
410/8/20 13:36
510/12/20 9:18
610/12/20 14:42
Sheet1
Cell Formulas
RangeFormula
A3A3=LEFT(A1,19)*1
A4A4=MID(A1,20,19)*1
A5A5=MID(A1,39,19)*1
A6A6=RIGHT(A1,19)*1
 
Upvote 0
Use
=LEFT(A1,19)*1
=MID(A1,20,19)*1
=MID(A1,39,19)*1
=RIGHT(A1,19)*1

The *1 is to change the text output to a date value, otherwise it will stay as TEXT


Book1
A
106-10-2020 10:00:0008-10-2020 13:36:0012-10-2020 09:18:0012-10-2020 14:42:00
2
310/6/20 10:00
410/8/20 13:36
510/12/20 9:18
610/12/20 14:42
Sheet1
Cell Formulas
RangeFormula
A3A3=LEFT(A1,19)*1
A4A4=MID(A1,20,19)*1
A5A5=MID(A1,39,19)*1
A6A6=RIGHT(A1,19)*1
Thak you! :)
 
Upvote 0
Formula option is fine but you could also have used Text to Columns (either manually or by macro) with Fixed Width of 19 characters.

1608892565904.png


Result automatically formatted (for me anyway)

20 12 25.xlsm
ABCDE
106-10-2020 10:00:0008-10-2020 13:36:0012-10-2020 09:18:0012-10-2020 14:42:006/10/2020 10:008/10/2020 13:3612/10/2020 9:1812/10/2020 14:42
Split Date & Time (2)
 
Upvote 0
Formula option is fine but you could also have used Text to Columns (either manually or by macro) with Fixed Width of 19 characters.

View attachment 28542

Result automatically formatted (for me anyway)

20 12 25.xlsm
ABCDE
106-10-2020 10:00:0008-10-2020 13:36:0012-10-2020 09:18:0012-10-2020 14:42:006/10/2020 10:008/10/2020 13:3612/10/2020 9:1812/10/2020 14:42
Split Date & Time (2)
Thanks.
 
Upvote 0
You're welcome.

BTW, if you are preferring a formula solution, and assuming 4 date/time values per cell here is another option. It only needs to be entered in column B and all 4 results should automatically 'spill' across the 4 result columns.

20 12 25.xlsm
ABCDE
106-10-2020 10:00:0008-10-2020 13:36:0012-10-2020 09:18:0012-10-2020 14:42:0006/10/2020 10:00:0008/10/2020 13:36:0012/10/2020 09:18:0012/10/2020 14:42:00
Split Date & Time (3)
Cell Formulas
RangeFormula
B1:E1B1=--MID(A1,SEQUENCE(,4,,19),19)
Dynamic array formulas.



.. and if you actually have a column of such values you can get all 4 results for all rows at once with this formula in the top left result cell only.

20 12 25.xlsm
ABCDE
106-10-2020 10:00:0008-10-2020 13:36:0012-10-2020 09:18:0012-10-2020 14:42:0006/10/2020 10:00:0008/10/2020 13:36:0012/10/2020 09:18:0012/10/2020 14:42:00
226-10-2020 08:00:0008-10-2020 13:36:0019-10-2019 09:14:0012-10-2020 14:42:0026/10/2020 08:00:0008/10/2020 13:36:0019/10/2019 09:14:0012/10/2020 14:42:00
301-11-2020 08:15:0008-10-2020 13:01:0012-03-2020 09:18:0012-12-2020 14:59:0001/11/2020 08:15:0008/10/2020 13:01:0012/03/2020 09:18:0012/12/2020 14:59:00
Split Date & Time (4)
Cell Formulas
RangeFormula
B1:E3B1=--MID(A1:A3,SEQUENCE(,4,,19),19)
Dynamic array formulas.
 
Upvote 0
You're welcome.

BTW, if you are preferring a formula solution, and assuming 4 date/time values per cell here is another option. It only needs to be entered in column B and all 4 results should automatically 'spill' across the 4 result columns.

20 12 25.xlsm
ABCDE
106-10-2020 10:00:0008-10-2020 13:36:0012-10-2020 09:18:0012-10-2020 14:42:0006/10/2020 10:00:0008/10/2020 13:36:0012/10/2020 09:18:0012/10/2020 14:42:00
Split Date & Time (3)
Cell Formulas
RangeFormula
B1:E1B1=--MID(A1,SEQUENCE(,4,,19),19)
Dynamic array formulas.



.. and if you actually have a column of such values you can get all 4 results for all rows at once with this formula in the top left result cell only.

20 12 25.xlsm
ABCDE
106-10-2020 10:00:0008-10-2020 13:36:0012-10-2020 09:18:0012-10-2020 14:42:0006/10/2020 10:00:0008/10/2020 13:36:0012/10/2020 09:18:0012/10/2020 14:42:00
226-10-2020 08:00:0008-10-2020 13:36:0019-10-2019 09:14:0012-10-2020 14:42:0026/10/2020 08:00:0008/10/2020 13:36:0019/10/2019 09:14:0012/10/2020 14:42:00
301-11-2020 08:15:0008-10-2020 13:01:0012-03-2020 09:18:0012-12-2020 14:59:0001/11/2020 08:15:0008/10/2020 13:01:0012/03/2020 09:18:0012/12/2020 14:59:00
Split Date & Time (4)
Cell Formulas
RangeFormula
B1:E3B1=--MID(A1:A3,SEQUENCE(,4,,19),19)
Dynamic array formulas.
Thank you, I was going to ask that question and u answered it before I asked. hehe :D thankyou very much!

and I have another issue, once I split the dates in to cells, those are visible as (Text) Strings, not Date type cells. so What Can I do to make it date and time format.
 
Upvote 0
those are visible as (Text) Strings,
My formula actually returns Dates (numbers) not text strings. That is what the "--" just after the equals sign does.
You may need to select the result columns and format them to your preferred Date/Time format. For my mini-sheets above, i used this format:

1609302602274.png
 
Upvote 0
Thank you, I was going to ask that question and u answered it before I asked. hehe :D thankyou very much!

and I have another issue, once I split the dates in to cells, those are visible as (Text) Strings, not Date type cells. so What Can I do to make it date and time format.

My formula actually returns Dates (numbers) not text strings. That is what the "--" just after the equals sign does.
You may need to select the result columns and format them to your preferred Date/Time format. For my mini-sheets above, i used this format:

View attachment 28755
Ok Thanks You very very Much :) :) :)
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,233
Members
449,092
Latest member
SCleaveland

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