简体   繁体   中英

How to get coords of cell in google sheets?

Is there any possibility to get the coords of cell that contains a value?

example: result

in this example the result is "C5" How to get this? Thanks in advance

In your situation, how about the custom function using Google Apps Script as follows?

Sample script:

Please copy and paste the following script to the script editor of Spreadsheet and save the script.

const SAMPLE = text => SpreadsheetApp
  .getActiveSheet()
  .createTextFinder(text)
  .matchEntireCell(true)
  .findAll()
  .map(r => r ? r.getA1Notation() : "")
  .join(",");
  • In order to use this, please put a formula of =SAMPLE("Text1") to a cell as the custom function. By this, the found cell is returned as the A1Notation.

References:

For a formula, you could try something like this:

=ArrayFormula(textjoin(",",true,if(A:C=D5,address(row(A:C),column(A:C),4),)))

在此处输入图像描述

assuming you want to search columns A to C. If the formula is on the same sheet, you couldn't search the whole sheet because you would get a circular reference error, but you could put it on a different sheet:

=ArrayFormula(textjoin(",",true,if(Sheet3!A:Z=A2,address(row(Sheet3!A:Z),column(Sheet3!A:Z),4),)))

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM