Excel: Is there a formula for this big space in between another? [closed]

ぃ、小莉子 提交于 2020-01-03 06:40:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!