OFFSET, XLOOKUP or FILTER function for Extracting Baseball Data? Excel Magic Trick 1697.

Поделиться
HTML-код
  • Опубликовано: 22 авг 2024

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

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

    The best Excel channel on RUclips. Thanks for publishing!

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

      You are welcome for the publish!!!!

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

    Great video!!!Filter is efficient, xlookup is beautiful , offset is visual. There are endless approaches. Other couple of them:
    =FILTER(B12:E128,ISNUMBER(XMATCH(B12:B128,SEQUENCE(C5-C4+1,,C4))))
    =INDIRECT("B"&11+XMATCH(C4,B12:B128)):INDIRECT("e"&11+XMATCH(C5,B12:B128))
    =INDEX(B12:B128,MATCH(C4,B12:B128,0)):INDEX(E12:E128,MATCH(C5,B12:B128,0))
    Who likes filter likes science, who likes xlookup likes art😊

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

      Thanks, Teammate!!!! I added your formulas to the download workbook : )

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

      The good old: INDEX:INDEX, before we had XLOOKUP!!!

  • @fernando5166
    @fernando5166 11 месяцев назад +1

    every day I learn more thank you

  • @wmfexcel
    @wmfexcel 3 года назад +6

    Interesting use of XLOOKUP! Brilliant!
    Also it's very good to highlight the impact of sorting on the output of three different approaches. Super!

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

    😍 Love the FILTER.
    Some more alternative formulas
    =FILTER(B12:E128,1-(B12:B128C5))
    =FILTER(B12:E128,ABS(B12:B128-(C4+C5)/2)

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

      LOVE 'em!!!!!! Those are fun : )

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

      I added your formulas to the download workbook : ) Go Team!!!!

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

      Thank you 😍

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

      @@ExcelWizard Such a great Team : )

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

    What video quality! Exceptional explanation. I love the part where you compare the different methods. Thank you for sharing it Mike!

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

      You are welcome for the share!!!!

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

      Glad you like the share and compare, Ivan : ) : )

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

    What I know about excel is thanks to you, Mike. I'm learning so much and using every day in my job to solve many challenges! Each formula has new tricks! Thank you!

  • @BillSzysz1
    @BillSzysz1 3 года назад +3

    Great use of XLOOKUP, Mike!! :-)))
    From my side almost old way (almost because of SEQUENCE and dynamic arrays)
    =INDEX(B12:E128,MATCH(SEQUENCE(C5-C4+1,,C4),B12:B128,0),SEQUENCE(,4))
    This can be used for both a sorted and unsorted range (but only if we have a year column with unique values).
    Once again, thanks for a great video, Mike :-))))

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

      It's a nice function. It's a real shame that INDEX didn't ignore FALSE (or Zero, negative or NA) values. As far as I can see, FILTER() is just an INDEX function that allows for that. For example, if I used =INDEX(B12:E28,ROW(B12:B128)*(B12:B128>=C4)*(B12:B128

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

      Great Formula, Bill Szysz!!!! Excel Wizard did this one too : )

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

      @@ricos1497 Just a fun note: back in the VERY first edition of Excel, back when it was Multiplan not Excel yet, INDEX was the second lookup function, after LOOKUP, but before VLOOKUP : )

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

      I added your cool formula to the download workbook, Bill Szysz : ) : )

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

      @@excelisfun it makes total sense that it would be, it's such a logical function on a spreadsheet. I'm surprised they even bothered with either lookup and didn't just rely on the match function in the row and column criteria. I suppose it's far more obvious now that there are dynamic arrays that return tables of data.

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

    Great work, i prefer filter. Thanks Mike!👍👍👍

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

      Yes, FILTER is fabulous!!!!

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

    Thanks Mike...I liked Filter the most but xlookup is up on my list too. Thanks for the video. Good luck with progress on the book. Looking forward to it whenever you finish it...

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

      Book is going REALLY slow. 2 pages a day... : ( But I am on chapter 14, page 320 of about 700...

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

    I prefer FILTER because of its versatility (robustness) and the fact that its filter logic seems more intuitive to me.
    I just wish we could use wildcards, though, just like we can in the *IFS-functions.

    • @excelisfun
      @excelisfun  3 года назад +4

      You can use "sort of wild cards", if we use SEARCH or FIND...
      FILTER is definitely robust : )

    • @t.pigeon2384
      @t.pigeon2384 3 года назад

      @@excelisfun Depending on what you are trying to do, you can use IFS functions in the filter criteria...

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

      @@excelisfun I know Mike, it’s just that in SUMIFS, for instance, we don’t even have to, we can just use “Soyuz*” as a criterion.
      Very elegant - no need to ‘stack’ functions (so much).

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

      @@GeertDelmulle Yes, very elegant : )

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

      @@t.pigeon2384 To be absolutely clear, with *IFS-functions, i mean functions like SUMIFS, AVERAGEIFS, etc., not the IFS-function itself. That’s a different kind of function. If those are the kind of functions you were thinking of as well, then... I fail to see exactly how you would use those functions in the filter criteria. Can you give an example?

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

    Awesome teachings as usual!

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

      Fun is fun, especially with Excel : ) Glad you like my videos, Pete!!!

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

    This is super amazing and XLookUp is just getting crazier day after day...
    Dope.... I'm happy I got my M365, now I can try all your lessons from day 1 of your M365 lessons
    Thanks sir... You're super amazing

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

    Great work Mike!

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

      Glad you like it, Chris M!!!! Thanks for your consistent Teammateshipness : )

  • @robertovelicaz7719
    @robertovelicaz7719 3 года назад +4

    Informative as always! Great examples. Thanks Mike!

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

      You are welcome, Roberto!!!!

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

    A great tutorial and very well explained. Thanks Mike..

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

    Amazing one! Very very informative 👏 Thank you Mike 😊

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

    Perfect and Amazing ... thanks Mike

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

      You are welcome, Hussein!!!

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

    Great tips & comparison. Thanks, Mike

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

      You are welcome, Jim : )

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

    nice Mike Thanks

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

      You are welcome, Sevag!!!

  • @ricos1497
    @ricos1497 3 года назад +4

    Great work. I'd go xlookup too, there's just something nice about it. I love the fact it returns a cell reference. It's just good.

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

      Yes, VLOOKUP and LOOKUP can't do that. I like it too : )

    • @t.pigeon2384
      @t.pigeon2384 3 года назад

      DR Steele pointed out a problem with Xlookup in this situation. Check his comment.

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

      @@t.pigeon2384 yep, Mike mentioned the sort issue in the video. I'd still use it though, I'd just be aware of its limitations. Although these days, I'm certain I'd have all that data in power query anyway, so that users couldn't break it by sorting!

    • @t.pigeon2384
      @t.pigeon2384 3 года назад +1

      @@ricos1497 whoops didn't watch the video :) I always try to do the magic tricks without or looking at answers and if my answers match, I skip the video. Sorry Mike!!!

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

      @@ricos1497 Power Query is good that way : )

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

    Filter is so neat. I fail to have ready a set of criteria to use in the "include" argument of FILTER. For example you used the AND logical test (B12:B128>=C4)*(B12:B128

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

      When you learn statistics and boolean math, then you learn that * is AND Logical Test and + is OR Logical Test.

  • @VivekGupta1994
    @VivekGupta1994 3 года назад +3

    Amazing...

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

      Glad it is amazing for you, CA V G!!!!

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

    AWESOOOOME xlookup and offset tricks. Super love this!

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

      Glad you super love 'em, Edge!!!

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

    Wow....Great guru ...👍

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

      Glad you like it, Tulsidas!!!

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

    Awesome tips!

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

    Yes
    FIlter is nice for all Conditions.

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

    Super vid, Mike! I think FILTER works best when using Excel Tables because they are frequently sorted by users in various ways and have columns inserted and deleted. Also. I've been coloring the cell containing a spill formula a certain way - diagonal shading from the top left to bottom right in the cell. It makes it easy to identify the spilling formulas.

    • @t.pigeon2384
      @t.pigeon2384 3 года назад +1

      Extremely good point. Filter is the only formula that works no matter what basically. I would propose to modify the solution as follows.
      =SORT(FILTER(B12:E128,(B12:B128>=C4)*(B12:B128

    • @t.pigeon2384
      @t.pigeon2384 3 года назад

      The sort is obviously not needed except to make the results sorted by Year (or whatever)

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

      Yes, Excel Table is the way to make it purely dynamic!!!!

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

    Amazing as always👍 Thank you for sharing😃👍

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

      You are welcome for the share!

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

    GREAT COMPARISON!

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

    In a case like this (filtering between two sorted limits), Xlookup is the easiest to understand just by looking at it. Filter would be my next choice. With LET, any of these will work even better

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

      Yes, LET is even better!!!

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

    Great, just learned how use AND inside a filter function... THANKS!!

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

      Yes!!!! AND inside Filter is indispensable : ) AND = * OR = +

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

      AND logical Test = multiplication = *
      OR logical Test = addition = +

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

    Thank you for the nice vid.

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

    3. (00:35) FILTER function.
    6. (05:06) Compare all methods.
    7. (05:48) Summary, Closing and Video Links

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

    This is brilliant but the non 365 users will not be able to use either of these solutions since the offset is using the xmatch. Regardless of the 365 impediment these are great solutions.

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

      You can use MATCH rather than XMATCH : )

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

    Wonderful Video

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

    Thanks Mike. Always amazingly done!!! :)

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

      Glad you like it, Formula Guy : )

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

    Like always, EXCELlent video. Thanks Mike for the share.

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

      You are welcome for the share, Syed M M : )

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

    Boom!Loving These Great Formulas,I Would Go XLOOKUP Too Such A Cool Function...Thank You Mike :)

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

    Impressive!

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

    great video Mike thanks for knowledge share , and ...no preference for formulas
    so what I understand let the context decide :)

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

      Context does decide everything in the end ; )

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

    Why haven't I seen this one before? , all three methods, wonderful, well perhaps not filter, but using using xlookup to return an array was something I had no idea about. I don't think it's in the MS docs?

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

      But... FILTER is the only one that can handle any type of sort, and you know what we people do with data. Colon operator for looks like INDEX and XLOOKUP have been around forever, but since Microsoft Help is so horrible a lot of the time (like what are the people in the help department at Microsoft even getting paid for), this does not show up in a lot of documentation. But, in this particular situation, the colon operator does show up in the current Microsoft Help for XLOOKUP.

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

    FILTER!! FILTER was made for this situation. XL a strong contender but a bit more complex for this situation. OFFSET? Participation Trophy!! LOL.

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

      lol... FILTER is the winner ; )

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

    Can we also use index with the small function with and 2 ifs conditions which should work similar to the filter function?

  • @t.pigeon2384
    @t.pigeon2384 3 года назад

    I don't know if this should count because it requires an area the size of the table to spill properly, but here goes...
    =SORT(IF((B12:B128>=C4)*(B12:B128

    • @t.pigeon2384
      @t.pigeon2384 3 года назад

      Let version with unique wrapper to get rid of blanks.
      =LET(r,B12:B128,SORT(UNIQUE((IF((r>=C4)*(r

    • @t.pigeon2384
      @t.pigeon2384 3 года назад

      If you don't care about sorting
      =LET(r,B12:B128,UNIQUE(IF((r>=C4)*(r

    • @t.pigeon2384
      @t.pigeon2384 3 года назад

      =UNIQUE(IF((B12:B128>=C4)*(B12:B128

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

    Sweet! However, if the lookup table is sorted by year, only XLOOKUP works and displays the full table of values between the Start Year and earlier End Year. Disappointingly FILTER returns #N/A (although a good hint!), and OFFSET returns only the Start Year. FILTER is still best, but is there a way to restrict the Start and End years from this problem? I know it's kind of silly for someone to select an END year before the START year, but well you know...

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

      Yes, we could use data validation : )

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

    Hi, the return array for the first xlookup was the year and the return array for the 2nd xlookup was the games so why did xlookup return the whole table? How did it know to return the columns in between? Does the colon operator say give me all the columns between the two return arrays?

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

      Microsoft programmed the colon operator to grab all cells between the first and second XLOOKUP.

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

    Great comparisons! Out of curiosity - which team do you usually root for?

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

      Oakland is where I grew up. I am Oakland A's, Raiders and Warriors to the max : )

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

      ​@@excelisfun I am a big Blue Jay fan so thanks for the Josh Donaldson trade some years ago! If there is any consolation - we traded Liam Hendricks to you guys on a separate deal :)

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

      @@derekcanmexit O, Blue Jays!!!!! I remember Ricky Henderson single handedly annihilating the Blue Jays in a Championship series in late 1980s, can't remember the exact year and then later, Rickey Henderson played for Blue Jays. I also remember Joe Carter game winning home run in 1993 for the Blue Jays in World. Baseball is fun!!!!

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

      @@derekcanmexit You are welcome for Josh Donaldson!!!

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

      @@excelisfun Henderson was definitely a game changer. Always dreaded when he came up to bat vs. the Jays and I can't believe he played until he was 44! Amazing! Also, credit to the A's for consistently making the playoffs as a small market team! Billy Beane is a genius - loved reading about him in Moneyball!

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

    What excel version you using? Thank you

  • @t.pigeon2384
    @t.pigeon2384 3 года назад

    Just 'cause I need LET practice :)
    =LET(l,B12:B128,t,B12:E128,XLOOKUP(C4,l,t):XLOOKUP(C5,l,t))

    • @t.pigeon2384
      @t.pigeon2384 3 года назад

      Suggestion for a sequel. Same exercise but return a 5th column that shows how many games the loser won. Note: I did not try this so I am not sure how it will work exactly but it should be doable and fun for the crazy folk like me.

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

      LET is good!

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

      I added your formulas to the download workbook : ) Go Team!!!!

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

    please help me
    name Qty
    Pop 5
    Joy 3
    Lila 1
    Append result
    pop
    pop
    pop
    pop
    pop
    joy
    joy
    joy
    Lila