Google Sheets - Query IN List Like SQL or Many ORs Using a Range Tutorial - Part 7

Поделиться
HTML-код
  • Опубликовано: 19 окт 2024
  • Learn how to create SQL like IN statement in QUERY function available in Google Sheets using join logic.

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

  • @blackandDecker22
    @blackandDecker22 6 лет назад +7

    Thanks a lot man, I spent 4 hours yesterday trying to figure out how to query/filter based on values of a list and that dynamic thing you built there was perfect. If I could like this video 10000000 times I would.

  • @samoht76
    @samoht76 6 лет назад +2

    Thank you, you made me realize that there are so many ways to cheat in google sheets. A real eye opener!

  • @badmazafaker3454
    @badmazafaker3454 5 лет назад +4

    Interesting approach, thanks for sharing it! There's a simpler way, however. The next function will do the same: =FILTER(Transactions!$A$1:$L, MATCH(Transactions!$A$1:$D, A$2:$A$9,0))

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  5 лет назад +7

      I have that in FILTER video, but this is QUERY series.

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

    Thanks a million!! This knowledge never gets old.

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

    Like always, right on the money! Just what I was needing.

  • @HenryDara1
    @HenryDara1 4 года назад +1

    Thank you for your great videos, they are the very best available. I like using query in place of formula drive functions, but wonder if one way is better as far as processing speed. Can I go too far with queries, or is it a case by case kind of thing? Thanks again.

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

    Interesting idea, well explained - can't imagine ever using it though!

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

      As with any other function, it's useful when you need it :)

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

    God bless your family

  • @leopolon
    @leopolon 6 лет назад +1

    Amazing tutorial. Thank you a lot. You are really tacking a lot o important issues for full functionality of google query. Please keep up! May i ask a question? Since google query lacks FROM clause. Can you think of any other way to tackle it besides joining tables with match/index or Vlookup?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  6 лет назад +2

      At this point there is no JOIN like SQL, so we'll have to stick with regular lookups for this.

  • @mochannel2482
    @mochannel2482 10 месяцев назад

    Fantastic job

  • @roberth.2779
    @roberth.2779 6 лет назад

    Exactly what I was looking for. One question though. You mentioned in the very last minute if I use numbers instead of text I need to remove the a apostrophes - I kind of struggle with it. Can you put your final formula without those?

  • @WasanKhunnadiloksawet
    @WasanKhunnadiloksawet 5 лет назад +1

    This is what I want . THANKS

  • @Mark-h1q1e
    @Mark-h1q1e Год назад

    how would I go about adding another argument. for example Where Col2 / B "Kyle Cruz"
    I'm wanting to importrange where everything is relevant to the query but ignore data with certain criteria.

  • @LukaszKawalec
    @LukaszKawalec 6 лет назад +1

    Great tutorial! Thanks! How about extracting the same data, but from another worksheet? How to do it?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  6 лет назад +2

      Not exactly sure what you mean, but probably IMPORTRANGE function is what you need. I have a video on it.

    • @LukaszKawalec
      @LukaszKawalec 6 лет назад +1

      I mean if your "Transaction" sheet would be in another workbook...Would it be something like this?: =IMORTRANGE(QUERY(Transactions!$A$1:$L$20001, ”SELECT A, B, C, D, F WHERE D = ' " & TEXTJOIN(" ' OR D = ' " , TRUE,A2:A9)&” ’ ”,1))

    • @leopolon
      @leopolon 6 лет назад +1

      That is the spirit! However, you will need to use "SELECT Col1, Col2, Col3, Col4, Col6 WHERE Col4 = ..." instead of letters. (it is a must to type Col1, not col1 or COL1, k?)
      Moreover, the IMPORTRANGE functions has 2 arguments: URL and range. So it will be more like:
      =QUERY(IMPORTRANGE("[your spreadsheet URL here]","[the range you want to import]";"SELECT...."

    • @LukaszKawalec
      @LukaszKawalec 6 лет назад +1

      +Leonardo Polon Thanks!

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

    Can I use join syntax in google sheet sir. Not the combination of query & vlookup.

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

      No, query function doesn't support joins. At least not at the moment.

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

    Had a quick question on Query ....I have data in which one column has number format as " AB12234" when I use query function it's gives put as " " can you please provide resolution for this .... thank you

  • @MrLeanLogistics
    @MrLeanLogistics 5 лет назад

    Hello, It's a great video. I need this formula but with opposite, so I need data what it are not in the list. Can you help me?

    • @MrLeanLogistics
      @MrLeanLogistics 5 лет назад

      I found a solution I use AND operator in TEXTJOIN instead of OR...

  • @alibirouti7193
    @alibirouti7193 5 лет назад

    thank you

  • @cuneiformscript2665
    @cuneiformscript2665 4 года назад

    🙏🏻

  • @mbany92
    @mbany92 5 лет назад

    Can the reverse be done? Is it possible to say “where not D =“ or “D ” in order pull data but exclude ones that match a particular column? I just tried it and it’s not working for me for some reason

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  5 лет назад

      WHERE D != 'something' or WHERE D 'something' both should work.

    • @mbany92
      @mbany92 5 лет назад

      @@ExcelGoogleSheets Didn't work for some reason. The only thing that worked was "where not D matches '" & TEXTJOIN("' AND NOT D matches '",TRUE,K3:K)&"'" Even with my formula, if I switch the "AND" to "OR" makes my formula not work. Do you know why that might be?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  5 лет назад

      matches means you use regular expression, so there might be spaces before and after in your data, also QUERY is by default case sensitive, so if you type APPLE it will not match Apple.

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

    how can i troubleshoot if this doesnt work anymore on my file?
    the other day it reflects normally but suddenly today it doesnt work as intended, i tried changing it to an array as well but nothing happened

  • @westonschild2596
    @westonschild2596 5 лет назад

    Does this still work in sheets? I can't get this to cooperate for the life of me. Values will return only if copied to multiple cells and they don't seem to be updating when source data is changed.

  • @lazalazarevic6192
    @lazalazarevic6192 6 лет назад

    #cheeky

  • @Bochagmo
    @Bochagmo 6 лет назад

    Hi !
    Thanks for the tutorial its very usefull. But (always there is a "but") i have problem
    How can i make a join 3 tables like:
    ..........Table PERSONS...................
    IdPerson,name,age
    1,Tom,15
    2,Nicolas,20
    3,John,22
    .........Table PROFESSIONS............
    IdJob,jobName,hoursPerWeek
    20,tech,6
    21,teacher,4
    22,poet,10
    ......PERSONS IN PROFESSIONS...
    IdPerson, IdJob
    1,20
    1,21
    2,22
    2,20
    3,22
    .........................................................
    And i need to see all the people's work(and other colums) like:
    name,jobName
    Tom,Tech
    Tom,Teacher
    Nicolas,Poet
    Nicolas,Tech
    John,Poet
    Can you help me ?
    Thanks for your time

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  6 лет назад

      At this point you will need to write a script for this. It's not going to be simple.

    • @Bochagmo
      @Bochagmo 6 лет назад

      @@ExcelGoogleSheets :( Ok, i will look for a solution.it has to be done.
      Anyway, thanks for your help !!

  • @davidmackey6540
    @davidmackey6540 6 лет назад

    I wonder if you can help me with the following "challenge"
    Col1 is Status
    Col2 is Value
    Col3 is a url
    I want to parse out values from the url in Col3 that contains utm parameters.
    The url looks like this:
    xyz.com.au/?Google&NSW&Air&gclid=EAIaIQobChMIqqWxqs_J2QIVxhWPCh2iQgFLEAAYASAAEgKcHvD_BwE
    There are a number of known variables for:
    source
    medium
    campaign
    content
    I want parse out the 4 values from the url in Col3 and use those values to create a pivot table with the values from Col1 and Col2.
    In other words, starting with 3 columns I want to end with:
    Col1 Status
    Col2 Value
    Col3 source
    Col4 medium
    Col5 campaign
    Col6 content
    Hopefully that makes sense?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  6 лет назад

      I would you regexextract function for that. I have several videos on Sheets regex functions.

  • @starvinmcmarvin
    @starvinmcmarvin 5 лет назад

    dude if you did this video with a growly voice you would sound like strong bad. :)

  • @sbhanuprakash9
    @sbhanuprakash9 4 года назад

    Hello Sir, I'm tired resolving this when I'm retrieving the data from another sheet. The list is displayed like this:
    M. Dedeepya Pinki Kumari Kalyani Sheena Evelyn Mula Aarthi Pandre Maheshwari
    Mustafa Ahmed
    Srinath Lekkala
    Phanindra Babu
    Akhil Dulam
    I should get the names as a list one below the other. Like this
    M. Dedeepya
    Pinki
    Kumari
    Kalyani
    Sheena Evelyn Mula
    Aarthi Pandre
    Maheshwari
    Mustafa Ahmed
    Srinath Lekkala
    Phanindra Babu
    Akhil Dulam
    Could you please help me out...