google spreadsheet - Remove characters from a string after a certain word - excel -


ive got list of imported data formatted following in excel / google spreadsheet. in column have full data , in b im trying strip out data left of word on.

full data                      |      stripped data   nnk gov on 31 aug cde          |      nnk gov  giffgaff.com on 30 aug cde     |      giffgaff.com tmrco stores  on 12 aug   cde  |      tmrco stores 

i using following forumal, falls down there non uniform white space there on last entry.

=left(a1, len(a1)-14)

is there more robust way can write this, dosnt fall on when there non uniform whitespace or additional wording after "cde" ?

ive created shared google spreadsheet here scratch pad : https://docs.google.com/spreadsheets/d/1iier_hak8qjpy8w6qq7ww9-640o-hzmflnnjecps6m4/edit#gid=0

im using google spreadsheets, although ive marked question excel ive found there many shared functions.


in excel:

=trim(left(a1,find(" on",a1))) 

this work in google sheets there may easier way in google sheets uses regex.

enter image description here


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -