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?
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.
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.
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With