C
C
chrispsow2019-02-22 12:55:30
Macros
chrispsow, 2019-02-22 12:55:30

Removing characters up to a specific combination in a Google Sheets/Excel spreadsheet cell?

There is a table It is
5c6fc5744d14c463086677.jpeg
necessary to leave in the cell only the characters that come after gclid=
There can be a lot of cells, so it's not an option to do it manually
Ideally, do it in Google spreadsheets. I tried to write a script, but it all ended there

function main() {
  var ss = SpreadsheetApp.getActiveSheet();
  var data = ss.getDataRange().getValues();
  for (var i = 7; i < data.length; i++) {
    var link = data[i][0];
  }
}

I wanted macros in Excel, but they are not written correctly
Which way to dig? How can it be implemented?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
shushpanio, 2019-02-22
@chrispsow


for cell R2 containing the entire text of the link, you need to write something like this:
5c6fccb2bae3c196089634.jpeg

A
Alexander Ivanov, 2019-02-22
@oshliaer

It does not work with scripts, try formulas first. For example,
=ARRAYFORMULA(REGEXEXTRACT(A2:A;".*?gclid=(.*)$"))
5c6fcc3c98a59827080515.png
https://docs.google.com/spreadsheets/d/1Nll6tQ-I9a...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question