How to extract URL from Link in Google Sheets using a formula?

后端 未结 9 1977
面向向阳花
面向向阳花 2020-12-13 09:33

I have copied from a website a series of hyperlinks and pasted them in a google sheet. The values show up as linked text, not hyperlink formulas, and are still linked correc

9条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 10:17

    If you happy to use Google Apps Script then use below function to get the hyperlink from a text. When you pass the cell, you should send with double quote. Eg: =GETURL("A4") to get the A4 hyperlink.

    function GETURL(input) {
      var range = SpreadsheetApp.getActiveSheet().getRange(input);
      var url = /"(.*?)"/.exec(range.getFormulaR1C1())[1];
      return url;
    }
    

    Refer here for example.

    Edit: Ignore this answer. This will only work if url is linked in cell.

提交回复
热议问题