using space between number and text

baidya91

Board Regular
Joined
Jun 1, 2016
Messages
147
How can I rewrite the duration '[TABLE="width: 205"]
<tbody>[TR]
[TD="class: xl64, width: 205"]19years7months1days' in excel in the format '19 years 7 months 1 days' using space.

A1= [TABLE="width: 205"]
<tbody>[TR]
[TD="class: xl64, width: 205"]19years7months1days

B1= 19 years 7 months 1 days[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
UGLY, but
Code:
=MID(A1,1,2)&" "&MID(A1,3,5)&" "&MID(A1,8,1)&" "&MID(A1,9,6)&" "&MID(A1,15,1)&" "&MID(A1,16,4)
probably would be much simpler using Custom function !
 
Upvote 0
How can I rewrite the duration '[TABLE="width: 205"]
<tbody>[TR]
[TD="class: xl64, width: 205"]19years7months1days' in excel in the format '19 years 7 months 1 days' using space.

A1= [TABLE="width: 205"]
<tbody>[TR]
[TD="class: xl64, width: 205"]19years7months1days

B1= 19 years 7 months 1 days[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]

Give this a try...
Code:
[table="width: 500"]
[tr]
	[td]=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"years"," years "),"months"," months "),"days"," days")[/td]
[/tr]
[/table]
 
Upvote 0
OMG.....obviously too much Xmas for me !!
nice one Rick....didn't even think of that..:banghead:
A much smarter option....merry xmas and a happy NY to your Rick
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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