Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy or get google sheet cell reference as string easily?

I hava a cell which is b30 in sheet sheet-alpha, I want get reference as string into clipboard, literally I want my clipboard contains string 'sheet-alpha'!B30

How do I do that in google sheet?

like image 525
jay.m Avatar asked Jan 29 '16 21:01

jay.m


People also ask

How do I get a cell string in Google Sheets?

To extract text from the middle of a text string, we can use the RIGHT, SEARCH and LEN functions to get the text from the right side of the string, and then use the MID and LEN functions to get the text in the middle. We will also incorporate the TRIM function to trim any spaces on either side of the text string.

How do I extract specific text from a cell in Google Sheets?

Extract data before a certain text — LEFT+SEARCH Whenever you want to extract data that precedes a certain text, use LEFT + SEARCH: LEFT is used to return a certain number of characters from the beginning of cells (from their left) SEARCH looks for certain characters/strings and gets their position.

How do I quickly copy a formula in Google Sheets?

You can copy a formula down in Google Sheets by using the fill handle (the little blue box in the bottom right corner of a selected cell) to drag over the applicable cells. Or you can use the keyboard shortcut Ctrl+D.


1 Answers

One solution to your need can be achieved in 2 steps:

First, open [top menu] Extensions > Apps Script and copy&paste the following function:

function getSheetName() {
  var sheetName = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getName();
  return sheetName;
}

The above code enables you to call the sheet name from wherever you need it by using the formula =getSheetName() in any cell.

Then, add another column to the right of column B (new Column C) and copy&paste the following array formula at the top most cell:

={"Ref 2 Str"; ARRAYFORMULA(IF(B2:B="","","'"&getSheetName()&"'!B:"&INDEX(ROW(INDIRECT("A"&(ROW()+1)&":A")))))}

The above function looks for non-empty cells on column B and for each non-empty cell it puts in column C the string reference for the corresponding cell in column B (in the format you need).

like image 68
Elad Ratson Avatar answered Sep 21 '22 15:09

Elad Ratson