google-sheetsformulasgoogle-sheets-query

In Google Sheets, How do I find the row number of a cell with certain text in it?


In Google Sheets, What do I do if I want a cell to display the row number in which a certain word/line of text appears?

So, I'm working with two kinds of spreadsheets here: One has the number of "Competitors" (which I'm looking for) in the 7th row of the spreadsheet, while others might have it in a different row. To work around this inconsistency, I want to set up a cell function which outputs the row number of where ever the "Competitors" number is, and then concatenate that function into a reference for the correct row-number.

The tables that I'm looking in all have the labels in the first column

Here are some viewable links to the Sheets I'm working on:

https://docs.google.com/spreadsheets/d/1SS_Bk2FFGNnsxhhg3RQGflTSxEncAjD-CaQBtPjTIVM/edit?usp=sharing

https://docs.google.com/spreadsheets/d/1JJvbiYUYT3zb8OFwHoF1WaLmEGkwO4N7lLLeBqgWRcw/edit?usp=sharing

^Notice how "Competitors" is in row 7 in one sheet but in row 6 in the other. This is why I need to find a function which can find a reference to the row number of "Competitors"


Solution

  • Figured it out - To find the row numbers that the string "Competitors" was in, All I had to do was use the MATCH function like this:

    =MATCH("Competitors", A:A,0)

    The user @Jeeped told me about the "Match" function in a comment under his answer. Although Jeeped's answer did demonstrate the "MATCH" function, he presented it being used along side the "SUM" function, which confused me at first. Give thanks/upvotes to Jeeped for helping me find the solution in this :)