Vidhi
Vidhi

Reputation: 89

How to extract a required text

I have a column which contains values of dates and text with certain file extensions. I split up the file names to 3 different columns, one of them has these dates and text.

Example: 13.04.26.xls(date) or v1.xls(text)

I want a formula to extract 13.04.26 and v1. I tried using "Right" formula but the number count varies as I have two different kinds of text.

Upvotes: 1

Views: 77

Answers (2)

Sathish Kothandam
Sathish Kothandam

Reputation: 1520

Try this

=SUBSTITUTE(LEFT(A1,FIND(".xls",A1)-1),".","-")

Upvotes: 1

Kazimierz Jawor
Kazimierz Jawor

Reputation: 19067

Assuming you have 13.04.26.xls in cell A1 and you want to get correct result to cell B2 just put the following formula in B1:

=MID(A1,1,SEARCH(".xls",A1)-1)

Upvotes: 1

Related Questions