问题
I have content which looks like this below in the excel. i need to trim away all the unnecessary info. Only keep the -.pdf. The remaining will be removed. i have tried several formula but only able to get the first document name.
1-Abc.pdf is a pdf containing important stuff
2-Def.pdf is a pdf containing important stuff
3-Ghi.pdf is a pdf containing important stuff
4-Jkl.pdf is a pdf containing important stuff
I need a formula which i able to get the final result like this below.
1-Abc.pdf
2-Def.pdf
3-Ghi.pdf
4-Jkl.pdf
Please help.
回答1:
Return everything before the first space character:
=left(A1, find(" ",A1&" ")-1)
This formula also works if there is no space in the source text.
回答2:
If the end of the text is always " is a pdf containing important stuff", you could use the following formula:
=LEFT(A1, LEN(A1) - 36)
Make sure you replace "A1" with the reference to the cell you need to extract the value from.
回答3:
This will return the document name regardless of the text string after that.
=LEFT(A1; FIND(".pdf";A1)+4)
来源:https://stackoverflow.com/questions/15484202/excel-is-there-a-formula-for-this-big-space-in-between-another