Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

to remove text from a sentence in excel after numerics

I have tried a lot but could not find a way to remove the text from a cell after first numeric.

Let suppose there is a name of a file mentioned in excel where i would like to remove the remaining part of file name after the date (i.e. remove text right right side after date)

the formula i am using is =LEFT(A3,SEARCH("1",A3)-1)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

in this formula it deletes the text after numeric 1 however there are many names where i have different numeric mentioned, therefore i could not find any solution so far

please see example below

enter image description here

Can anyone please advise if there any method to remove the text from right after every first numeric.

i will be thankful

>Solution :

You can use this formula:

=LEFT(A2,MIN(FIND({1,2,3,4,5,6,7,8,9,0},A2 & "1234567890"))-1)

Assuming that your names are in column A.

MIN(FIND({1,2,3,4,5,6,7,8,9,0},A2 & "1234567890")) returns the first = MIN position of each numerical value (1, 2, 3…)). To assure that each figure occurs at least once "1234…" is added to the string to be checked.

LEFT obviously returns the left part of the string.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading