+ Reply to Thread
Results 1 to 6 of 6

Google Sheets - Get only row number from query result

  1. #1
    Registered User
    Join Date
    09-01-2022
    Location
    US
    MS-Off Ver
    2013
    Posts
    28

    Google Sheets - Get only row number from query result

    Hi, currently I'm able to get the row number but it also come with another column information, but I wanted to get only the row number from the query result alone. is that possible?

    here is the sample data URL
    https://docs.google.com/spreadsheets...GwWsYxsNU/edit

    thank you!

    Capture 3.PNG

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,840

    Re: Google Sheets - Get only row number from query result

    This seems to work:

    =choosecols(ARRAYFORMULA(QUERY({A2:F11,ROW(A2:F11)}, "select Col6, Col7 where Col2 MATCHES '(" & JOIN("|", H2:H4) & ")'", 0)),2)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    09-01-2022
    Location
    US
    MS-Off Ver
    2013
    Posts
    28

    Re: Google Sheets - Get only row number from query result

    Hi, it work like a charm! I didn't even know that formula exist ^^, Thank you so much

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,840

    Re: Google Sheets - Get only row number from query result

    Neither did I, but it's in Excel so I checked here: https://support.google.com/docs/tabl...B#query=choose

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  5. #5
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,150

    Re: Google Sheets - Get only row number from query result

    You can use the INDEX function as well;

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,150

    Re: Google Sheets - Get only row number from query result

    But, a better solution is just using your original formula with only selecting Col7

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Google Sheets: Can I Query and Importrange two sheets which have different structures?
    By jayped in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 09-16-2022, 05:01 AM
  2. Google Sheets - QUERY to give a total number of times a class is listed
    By 404'ed in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 7
    Last Post: 07-25-2022, 08:07 AM
  3. Google Sheets: <=0 vs < =' ' in a query
    By BJANeeeco in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 07-28-2021, 08:44 AM
  4. Query in Google Sheets
    By PhilippBonnie in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 03-26-2021, 10:18 PM
  5. Google Sheets Array Query
    By AncestryGuy in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 03-26-2021, 06:24 AM
  6. Google Sheets QUERY How can I do the same in Excel?
    By Ziggy21 in forum Excel General
    Replies: 12
    Last Post: 10-04-2015, 07:54 PM
  7. Replies: 0
    Last Post: 07-13-2012, 02:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1