I'm trying to figure out how to duplicate part of the content of a column (text) to another column in other sheet. For example, I have column A in Sheet1 and I want to show only a word of this column in Sheet2. Here an example file.

2 Answers 2


Here how to do that with a script.


function myFind(findRange) {
  var output = [];
  var find = ["Vault", "Drive", "Apps"];

  for(var i=0, iLen=findRange.length; i<iLen; i++) {
    for(var j=0, jLen=find.length; j<jLen; j++) {
      if(findRange[i][0].indexOf(find[j]) !== -1) {
  return output;


The range is searched by the key words in the find array. Once a word is found, the search is stopped and the next search will commence. You can add more key words in the var find array.


The order of key words is very important. Better is to choose unique key words, like:

  • Google Vault
  • Google Drive
  • Google Apps

All is of course dependent upon the data available.


I've added the script (Tools>Script editor) and the ARRAYFORMULA version of the solution Punchlinern provided in your example file.

  • Perfect! I adopted the script solution. Thank you very much. Mar 9, 2014 at 22:06

If you only have those three strings to search for (Apps, Drive and Vault), you could use the following function, as suggested by shipr (edited to suit your cause and Google Spreadsheets):


Paste it into the first cell in the TABLE sheet and copy down. It's not overly beautiful, you have to add the IFERROR-part for every word you want to search for, but it works.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.