How to extract values between different caracteres ?

Inacio11

New Member
Joined
Jul 3, 2018
Messages
36
Hi.
At link below I have attached a excel file where I am trying to extract the data number (day-month-year) from 3 different texts and with different lenghts, but with no sucess till now. I have included more details on excel file.
I need the formula (not VBA) !
https://www.sendspace.com/file/c6s2ji
Thanks in advance !
Inacio
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
I'm sure there will be plenty of help available.....but....most posters will NOT download a file to look at your problem.
I'd suggest either describing your problem more clearly, or pasting some sample data directly to the forum
 
Upvote 0
I'm sure there will be plenty of help available.....but....most posters will NOT download a file to look at your problem.
I'd suggest either describing your problem more clearly, or pasting some sample data directly to the forum

Hello Michael,
I thought that could be easier to clarify, but I understanding you. I will try:

A B | C | D
A1: SMS from: 88888 2018-07-02 10:59:27 >>>>> 2 | 7 |2018
A2: From 27300 July 02, 2018 at 0721PM>>>>>>>2 | 7 |2018
A3: From 11108 July 02, 2018 at 1017PM>>>>>>>2 | 7 |2018

As you can see above the text in each row is slightly different from each other, so I'd like to extract just the numbers related to the dates highlighted on red colour to columns in separate

Columns
A = full text
B= day
C= month
D= year
Regards,
 
Upvote 0
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Column E[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]day[/TD]
[TD]month[/TD]
[TD]year[/TD]
[/TR]
[TR]
[TD]SMS from: 88888 2018-07-02 10:59:27[/TD]
[TD][/TD]
[TD]2[/TD]
[TD]7[/TD]
[TD]2018[/TD]
[/TR]
[TR]
[TD]From 27300 July 02, 2018 at 0721PM[/TD]
[TD][/TD]
[TD]2[/TD]
[TD]7[/TD]
[TD]2018[/TD]
[/TR]
[TR]
[TD]From 11108 July 02, 2018 at 1017PM[/TD]
[TD][/TD]
[TD]2[/TD]
[TD]7[/TD]
[TD]2018[/TD]
[/TR]
</tbody>[/TABLE]
Now it is better for understanding !!
 
Upvote 0
Hi,

This will accommodate either 5 or 6 digit Text addresses.

3 slightly different formulas for day, month, year, formulas copied down:


Book1
CDEFG
4daymonthyear
5SMS from: 88888 2018-07-02 10:59:27272018
6From 27300 July 02, 2018 at 0721PM272018
7From 11108 July 02, 2018 at 1017PM272018
8SMS from: 888889 2017-08-25 10:59:272582017
9From 273009 July 04, 2018 at 0721PM472018
10From 111089 January 31, 2015 at 1017PM3112015
Sheet119
Cell Formulas
RangeFormula
E5=DAY(LEFT(SUBSTITUTE(TRIM(MID($C5,MIN(FIND({0,1,2,3,4,5,6,7,8,9},$C5&"0123456789"))+6,255))," ",REPT(" ",50),IF(ISNUMBER(FIND(",",$C5)),3,1)),50)+0)
F5=MONTH(LEFT(SUBSTITUTE(TRIM(MID($C5,MIN(FIND({0,1,2,3,4,5,6,7,8,9},$C5&"0123456789"))+6,255))," ",REPT(" ",50),IF(ISNUMBER(FIND(",",$C5)),3,1)),50)+0)
G5=YEAR(LEFT(SUBSTITUTE(TRIM(MID($C5,MIN(FIND({0,1,2,3,4,5,6,7,8,9},$C5&"0123456789"))+6,255))," ",REPT(" ",50),IF(ISNUMBER(FIND(",",$C5)),3,1)),50)+0)
 
Last edited:
Upvote 0
Hi jtakw
First thanks for your early repply !
I did not understand yet, but the formulas works to text:
SMS from: 88888 2018-07-02 10:59:27

<tbody>
[TD="align: right"][/TD]

</tbody>
...but not for:
From 27300 July 02, 2018 at 0721PM
From 11108 July 02, 2018 at 1017PM

the result is #VALUE !

Inacio
 
Upvote 0
Have no idea what you mean, apparently it works for me as in my sample in Post #5 .

I've even just now tested on you Actual uploaded file at Sendspace, works fine.

You DO realize that there are 3 (three) Different formulas?

Using Post #5 for sample:

E5 formula for DAY, copied down.
F5 formula for MONTH, copied down.
G5 formula for YEAR, copied down.
 
Upvote 0
I've had a look at your new file and have No Idea why you have the #VALUE error in I6:K7...

If you select any of the Cells, say I6, click in the Formula Bar, hit Enter, the correct result Pops up.
Or, if you select I5, copy the formula and select I6:I7 and paste Formula, the correct results Pop up...

Don't know what you did there.

EDIT: Can you check and make sure you have Excel Calculations set to "Automatic"???
 
Last edited:
Upvote 0
Hi jtakw
First thanks for your early repply !
I did not understand yet, but the formulas works to text:
SMS from: 88888 2018-07-02 10:59:27

<tbody>
[TD="align: right"][/TD]

</tbody>
...but not for:
From 27300 July 02, 2018 at 0721PM
From 11108 July 02, 2018 at 1017PM

the result is #VALUE !

Inacio


Hi,

It depends on the regional settings of the excel you are working on.

Try to change
From 27300 July 02, 2018 at 0721PM with
From 27300 02 July, 2018 at 0721PM and July with the name of the month in your country.

and the formulas will work.
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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