QUERY - Select a Range of Multiple Columns in Google Sheets

Поделиться
HTML-код
  • Опубликовано: 13 сен 2024
  • How to get QUERY function in Google Sheets to select a range of columns?
    QUERY function playlist • Google Sheets Query fu...
    #query #googlesheets #advanced

Комментарии • 77

  • @JMC2935
    @JMC2935 3 года назад +7

    I'm following your lessons from France. Your pronunciation for a non native English listener and your teaching techniques are brilliant! I have so much improved my skills at work. I thank you so much!

  • @tecnoideas7436
    @tecnoideas7436 3 года назад +5

    Greetings from Paraguay. You are the best teacher ever. The content of your channel is liquid gold! I just asked my sister if she wants to marry you...

  • @nssdesigns
    @nssdesigns 2 года назад +1

    I binge watch ALL your videos. You are the goTo guy for advanced sheets stuff. This helps a lot!

  • @robertmaluka2763
    @robertmaluka2763 3 года назад +2

    I could never do query function. I just did filter function. Now I am starting with query function, Thanks again your videos so helpful, I learn so much.

  • @eugeniab9680
    @eugeniab9680 3 года назад +7

    so cool, as always! thanks for doing this!

  • @anvi84
    @anvi84 3 года назад +2

    Thank you for the new trick to use in the query formula. Am I the only one who gets excited when I see a new video posted by you? 🙂

  • @GM085
    @GM085 6 месяцев назад +1

    The Choosecols function, which was not available at the time of this video, can make the process easier. You can use Sequence inside Choosecols to select a range of columns. For example, if you want columns 3-7 and 10-15, the formula would look like this: =choosecols(query(TEXT!A1:T,"select *",1),sequence(5,1,3),sequence(6,1,10)). Forgivingly, it also works if you swap the rows and columns in the Sequence; i.e., in a Choosecols function, sequence(1,5,3) works the same as sequence sequence(5,1,3). If you have a long string in your Query, then putting it in a Let function and inserting some returns makes it simpler.

    • @ArthurBorges-yi7uh
      @ArthurBorges-yi7uh 4 месяца назад

      Thanks a million pal. That information helped me a lot. All the best

  • @Maestr055
    @Maestr055 3 года назад +1

    Never used SEQUENCE, awesome to learn, thanks!
    As always, my 0,02 $ just to give some alternatives:
    1. you can use MATCH to find the col number:
    =QUERY({TEXT!A2:G};"Select Col"&MATCH(A1;TEXT!1:1;0)&", Col"&MATCH(B1;TEXT!1:1;0)&", Col"&MATCH(C1;TEXT!1:1;0);1)
    you need to set the data array to skip the headers and the query sheet will need to have column names in it to look for.
    this can be very powerful in combination with a validated list for the column headers
    2. you can replace the ARRAYFORMULA with just a join (both formula's below amount to the same):
    =ARRAYFORMULA("SELECT " &JOIN(", "; "Col"&Sequence(1;10)))
    ="SELECT Col" & JOIN(", Col";SEQUENCE(1;10))

  • @TheHeatingEngineer
    @TheHeatingEngineer 2 года назад +2

    A great video, well presented and very informative. Well done and thanks.

  • @garychadwick1240
    @garychadwick1240 3 года назад +2

    Really useful for large data sets. Thanks as always!

  • @sukanandnarula8898
    @sukanandnarula8898 3 года назад +2

    I never comment on videos - but I have been using your video as guides and have managed to automate a lot of my business. I want to sincerely thank you for your videos. You are doing an awesome job and a great service. Always look forward to new videos. I was wondering if you have the time; could you do a video on google sheets and whatsapp integration - for example - like sending whatsapp message from sheets - or even better can take a message from whatsapp and pull corresponding data from the sheet and send back message to whatsapp.
    Anyways keep up the good work!

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 года назад +2

      Unfortunately, whatsapp currently doesn't have a publicly available API.

  • @SudipChakraborty-d5m
    @SudipChakraborty-d5m 5 месяцев назад

    Just what I was looking for. Many Thanks!

  • @tanveerhussain3881
    @tanveerhussain3881 3 года назад +1

    Nice Best Unique

  • @diaa2262
    @diaa2262 3 года назад +2

    Thank you very useful, Can we have the same idea with a dynamic range of rows.

  • @marcosrs75
    @marcosrs75 3 года назад

    Amazing trick! Seriously, one of the most brilliant! Your channel is the best one.

  • @alexmi5359
    @alexmi5359 3 года назад +1

    Thanks a lot! I had same issue early today! 😀

  • @HagridThoughts
    @HagridThoughts 3 года назад +1

    Thanks for putting these great videos together! They’re always helpful and spark new ideas.
    I was wondering if there is a way to dynamically select multiple columns by using checkboxes

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 года назад +5

      I have recorded a video on this. It will most likely be published next week.

    • @n3rVex
      @n3rVex 3 года назад +1

      @@ExcelGoogleSheets can't wait for that one!

  • @sharadgupta2007
    @sharadgupta2007 3 года назад +1

    Great

  • @johndarenvaldez5726
    @johndarenvaldez5726 2 года назад

    That is awesome buddy! You just solved my problem today. Thank you so much. New subscriber here from the Philippines.

  • @Julie-so5xe
    @Julie-so5xe Год назад

    will this work if I am getting the data from a different sheet? (i am always watching your tutorial btw, and it helps me a lot! thank you so much!

  • @dadtrepreneur7550
    @dadtrepreneur7550 Год назад

    Great tutorial video! Keep it up! I am trying to create a registration form, what would be the formula within this formula I want to pull data to how many people are registering? Would I have to create several different spreadsheet? For example 1 person, 2 people, 3 people, etc. But I don't want the data for 1 person to show in my spreadsheet for 3 people.

  • @mercyfrs
    @mercyfrs 3 года назад +1

    AWESONE...The true Master!!!

  • @eleuteriosousaramos9524
    @eleuteriosousaramos9524 Год назад

    AWESOME trick, thanks

  • @paketou8114
    @paketou8114 Год назад

    Thank you so much.

  • @emilianoreyes
    @emilianoreyes 3 года назад +1

    Thank You!

  • @MarcCastellsBallesta
    @MarcCastellsBallesta 3 года назад +1

    I currently have a query with such a long column list (C to AF) I almost feel ashamed of it.
    This will no longer happen!

  • @edwinrondina5491
    @edwinrondina5491 2 года назад

    Hi sir, you're the best teacher as always! Is there a way that I could select, unselect and select all data in a certain range dynamically thru data validation? Hope you may read my comment. Thank you very much sir!

  • @michelparmentier3063
    @michelparmentier3063 3 года назад +1

    Brilliant !

  • @Ali-Hassan-Shooq913
    @Ali-Hassan-Shooq913 18 дней назад

    Can we do same thing with rows?

  • @HassanAlmaateeq
    @HassanAlmaateeq 3 года назад +1

    Wow.. magic

  • @pyrageisold
    @pyrageisold Год назад

    how would I select every x row
    like if x was 5 how would I have it select rows 5 10 15 20 25 etc

  • @AzeemaFaizunnisa
    @AzeemaFaizunnisa 26 дней назад

    That is so clever.

  • @RajaGiri_tvpm
    @RajaGiri_tvpm 3 года назад

    In Join function, fixed Range as per your instruction works well, when I removed fixed Range , data add in another row join function get problem , not update , please guide me

  • @maciejrodak3590
    @maciejrodak3590 3 года назад +1

    It doesn't work for me when I'm trying to merge two ranges =QUERY({Arkusz2!B3:C;Arkusz2!E3:G};"Select *";1). The error is "In ARRAY_LITERAL, an Array Literal was missing values for one or more row". What's wrong?

    • @r.lemesh
      @r.lemesh 3 года назад

      have the same problem. help plz!

    • @maciejrodak3590
      @maciejrodak3590 3 года назад

      @@r.lemesh try something like that =QUERY({Dane2013!A2:B25\Dane2013!D2:J25};"Select *";1) it's different, but it works for me

    • @r.lemesh
      @r.lemesh 3 года назад +1

      @@maciejrodak3590 Thanks a lot, it works for me too. It seems like in NOT US formatted spreadsheets we should use "\" instead "," for uniting different columns in same range.

    • @SatryaNouvanda
      @SatryaNouvanda Год назад +1

      ​ @Maciej Rodak Thank you. A character changes everything.

  • @osvaldodsj
    @osvaldodsj 3 года назад

    Muito obrigado por compartilhar seu conhecimento!

  • @NewToneProducer
    @NewToneProducer 3 года назад

    Is there a way to make the columns that are selected based on a condition? For example, if I want to ignore columns that are blank, can I make it so it only selects columns that have text or numbers in them?

  • @247dman
    @247dman 3 года назад +2

    You should do a lesson on having a column name be dynamically linked within a query. (There's a fun hack so that if you change column order, you don't need to rewrite the overall query)
    "Select "®exreplace(ADDRESS(1,COLUMN('Sheet1'!$A$1),4),"[0-9].*","")&" where...

  • @arunthathirema6568
    @arunthathirema6568 2 года назад

    sir will the query function do column wise copy.for example if there are sheets with names Eng,Maths,Language and Each sheet with column labels test1,test2,test3. i want to pull out the values of test1/test2/test3 of all 3 subjects in a single table based on the drop down list.What is the query to be given. help in this regard

  • @gustavodecastrosantos1378
    @gustavodecastrosantos1378 3 года назад

    Great video thanks so much. Is it possible to add WHERE conditions in this formula ? I mean SELECT * WHERE Col 1 = 2021 for example.

  • @julianscantlebury4858
    @julianscantlebury4858 Год назад

    Thank you very much for this video. I found the technique very useful in simplifying some of my QUERY formulas. But if I may ask a follow-up question. I tried to use the same technique of JOIN and SEQUENCE with ARRAYFORMULA, but this time with a VLOOKUP within a QUERY (so I could do some 'sumproduct-like' calculations with a pivot table). Anyway within the VLOOKUP formula I was trying to use your technique above to create the index array (as I needed something like {9,10,11,...19,20} to specify the columns I wanted to use, which will change. However I got an error 'Can't perform the function sum on values that are not numbers'. Any pointers, or is it just the wrong tool to do this? Many thanks

    • @julianscantlebury4858
      @julianscantlebury4858 Год назад

      Apologies, I ended up answering my own question above with some further experimentation. All I needed was ArrayFormula(SEQUENCE(1,12,9). You don't need the JOIN to put the commas in or the concatenation of the {} brackets. Much simpler!

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Год назад

      👍

  • @jennreyes8199
    @jennreyes8199 Год назад

    Hi. Is it possible to use this formula, but I want to skip blank data on an included column?

  •  2 года назад

    Do you know if it's possible to do QUERY not with columns but with rows? I can't make it :(

  • @DarinPirkey
    @DarinPirkey 2 года назад

    Is there a way to query multiple sheets (same worksheet but different tabs) where I query different columns in different tabs? The data I'm using is autopopulated and the "Impressions" tabs for each are in different columns. So in one tab it might be column B but in another tab it is Column F (as an example). I know how to query from multiple tabs in a range but not when there data is in different columns. I currently use =QUERY({'Sheet1'!A2:C;'Sheet2'!A2:C;'Sheet3'!A2:C}, "select * where Col1 is not null",0) but instead of having to format each tab is there a way to just select which columns I want to pull per sheet?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  2 года назад

      Sure, it's the same exact formula, just change the column to whatever column you want.

  • @jodhvirsingh8677
    @jodhvirsingh8677 3 года назад

    Hello Sir...can you make a tutorial on how to import data (in google sheets) from webpages which require login id and password..thank you

  • @avi1710
    @avi1710 3 года назад

    I need a help ,. I need to copy a range from sheet1 and paste to last empty row in sheet2 in google sheet . Please help

  • @dylanmeyers4436
    @dylanmeyers4436 3 года назад +1

    Awesome :D

  • @mercyfrs
    @mercyfrs 3 года назад

    How to get the file. I wanna practice it.....Please can have this.

  • @mateusoliveiraalvarenga428
    @mateusoliveiraalvarenga428 3 года назад

    What if i'm trying to bring a lot of Columns, but I don't want to bring it any null cels (ex: =QUERY({'TEXT!A2:AB;'NUMBERS2!A3:AB};"SELECT Col3, Col9, Col10, Col11, Col12, Col13, Col14"...) If I put just "WHERE IS NOT NULL" or "WHERE Col3, Col9, Col10... IS NOT NULL" it doesn't work.
    Can someone give me a hand here?

  • @jjavkira
    @jjavkira 3 года назад

    veerry fuckin coool!! master!!, could you please make a video with querys that search by separated comma words and other cell DISCARDING comma sepparated words from other column?
    Thank so much you by the way!. I already learned html, css, javascript and jquery. I have encouraged myself to search and learn all that knowledge on my own being motivated for all your videos dude! Is really awesome that can you share this videoss!! Thankyou again we'll see you in other videos.

  • @user-mj9wm6dl1c
    @user-mj9wm6dl1c 3 года назад

    Tell me, how can I make a similar request, only through the API to get an answer in JSON format? You do not have a video on this topic?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 года назад

      Maybe check this on my other channel ruclips.net/p/PLRmEk9smitaVGAAhgU0Pdc2sEs7yxDrEk

  • @TheBambooProject
    @TheBambooProject 3 года назад

    I tried to run this script so that I can rearrange the sheets but nothing is happening and I keep getting this error
    “ Exception: Cannot call SpreadsheetApp.getUi() from this context. “
    // global
    var app = SpreadsheetApp.getUi();
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    // create menu entry in spreadsheet upon opening
    function onOpen() {
    app.createMenu('Move Sheet')
    .addItem('Move Active To Right Of', 'moveactiveSheet')
    .addToUi();
    }
    // move active sheet to position zero
    function moveactiveSheet() {
    var name = app.prompt('Move active sheet to the right of...', 'Insert name of sheet after which to move the active sheet', app.ButtonSet.OK_CANCEL)
    .getResponseText();
    var foundit = null;
    sheets = ss.getSheets();
    for (i=0; i

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 года назад +1

      Try to replace variable app with SpreadsheetApp.getUi() and remove the line var app = SpreadsheetApp.getUi();

    • @TheBambooProject
      @TheBambooProject 3 года назад

      @@ExcelGoogleSheets thank you I got it to work. What do I have to change so it goes to the left instead of the right

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 года назад

      ss.moveActiveSheet(0);

  • @omantel147
    @omantel147 3 года назад

    Hi, does anyone know how to replace AAPL with a cell reference in google sheets? www.stockcharts.com/h-sc/ui?s=AAPL

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  3 года назад

      ruclips.net/video/kRnntnyTgFU/видео.html
      ="www.stockcharts.com/h-sc/ui?s="&A1

    • @omantel147
      @omantel147 3 года назад

      @@ExcelGoogleSheets Thanks a million!

  • @giancarloschafloqueguzman9918
    @giancarloschafloqueguzman9918 3 года назад +1

    Awesome :D