Forum Discussion

Tiffany_Jo's avatar
Tiffany_Jo
Brass Contributor
May 11, 2020

How to remove the sentences from Excel

hi all

 

There is a long text in the Excel cell.

I would like to remove the sentence with the starting "PMID: ".

Which formula I could use to remove the sentence highlighted in red?

 

[回答]
癌腫別のMSI-high固形癌の割合の図のデータはペムブロリズマブの適応になる患者がどれくらいいるのか予測するために調査した文献の補助的なデータであり、解析が行われた癌腫毎の症例の母数や、詳細な解析方法についての記載は文献中(1)にありません。この論文のグラフは各癌腫におけるMSI-High患者の割合の参考データとしてご参照ください。

<引用>
(1)PMID: 28596308: Le DT, et al. Science. 2017; 357: 409-413.

7 Replies

  • naimbic's avatar
    naimbic
    Copper Contributor

    Tiffany_Jo 

     

     

    try these...

     

    =SUBSTITUTE(P8,"Plus d'informations","")
    
    =SUBSTITUTE(SUBSTITUTE(P9,"text-to-delete-1",""),"text-to-delete-2","")
    =SUBSTITUTE(P8,"text-to-delete","")
    
    =SUBSTITUTE(SUBSTITUTE(P9,"text-to-delete-1",""),"text-to-delete-2","")
    • SergeiBaklan's avatar
      SergeiBaklan
      Diamond Contributor

      naimbic 

      That doesn't work. The task is for the data like

      abasdas as asd das 
      PLUS: fdd;as dasdkas;d
      ,.dad.,f;dfe;;ee;
      s;dlflsdfl; as;df;
      PLUS: a;s; as;dlmas
      ===============
      ssssssssssssss

      remove all lines which start from PLUS:

  • Tiffany_JoIf the sentences you want to remove all begin with the same text - (1)PMID, then you could use Text to Columns on the Data tab to split the cell at that point. At then delete the new column created.

    You could also use Find and Replace to remove the content with that starting place using the wildcard characters - (1)PMID*

    Excel formulas can only return values and not delete content. So a formula approach would only create a good cell. Not correct the original.

    • Tiffany_Jo's avatar
      Tiffany_Jo
      Brass Contributor

      Hi Thank you.

       

      If I would like to use the Find and Replace, could you please kindly tell how to judge the length of the sentence which starts with PMID. I think the lengths are different.

      • Alan_Murray's avatar
        Alan_Murray
        MVP

        Tiffany_JoNo need. select the column, press Ctrl + H for Replace. Then use PMID* in the Find what and nothing in the Replace.

        The * is a wildcard character and will replace any text regardless of length after PMID.

Resources