deleting numbers shorter than x characters

Christiano

New Member
Joined
Jan 24, 2012
Messages
9
Hello, I have the following request, if someone is kind to help me.
The lines in excel look like this :

3 4 6353 18423875632
43 563 88888888
123 4444 55555555

Now, I want to erase all the numbers from these 3 rows EXCEPT the numbers longer than 5 characters. In the end, I want the sheet to look like this :

18423875632
88888888
55555555

Is this possible ?

Thank you very much,

Cristian
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Welcome to the forum.
Perhaps;
=MAX(--MID(SUBSTITUTE(" "&A1," ",REPT(" ",255)),255*ROW(INDIRECT("1:"&LEN(A1)-LEN(SUBSTITUTE(A1," ",""))+1)),255))
 
Upvote 0
Hello!
Glad to be here!

Thank you for the quick reply.
Sadly, no one works well. Or I don't know how to set it properly.
Where in the formula is the "x" number of characters ?

The adaption works in part only, not always showing the longest number of the streak. Sometimes is show the shortest.

10x
 
Upvote 0
I'm struggling to conjour up anything pretty, hence:

Code:
=LOOKUP(9.99E+307,-IF(LEN(-MID(SUBSTITUTE(" "&A1," ",REPT(" ",255)),255*{1;2;3;4;5;6;7;8;9},255))[B][COLOR="Red"]>=5[/COLOR][/B],-MID(SUBSTITUTE(" "&A1," ",REPT(" ",255)),255*{1;2;3;4},255),NA()))

Note the greater than or equal to 5 character length condition highlighted in red.
 
Upvote 0
Yeah, it's better.
Now it shows sometimes. But I noticed that where there are more than one space, it doesn't show anything.
For example, if a line is:
111111(space)5(space)666 --- it works

If the line is:
4(space)(space)6(space)(space)9(space)(space)(space)7777777
------ it doesn't work.

Also, the formula looks a bit complicated. Would it make it easier for you if I only request to show the longest number from a row ?

Ex: 5 7 90 105 66666666 ---- only 66666666 i want to remain.

Thanks again for your time,
 
Upvote 0
oops, mine wont work if there are no spaces, so try

=IF(LEN(A1)=LEN(SUBSTITUTE(A1," ","")),A1,MID(A1,FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))+1,255))

Cheers
GB
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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