Excel LAMBDA Recursion + a Trick for Evaluating in a Cell

Поділитися
Вставка
  • Опубліковано 7 вер 2024

КОМЕНТАРІ • 77

  • @rudiklein
    @rudiklein 3 роки тому +7

    🤯 I shouldn't be watching these kind of videos before going to sleep.

  • @patrickschardt7724
    @patrickschardt7724 3 роки тому +2

    Keeping track of the exit strategy and testing recursion are very hard. Great stuff

  • @guranslifes
    @guranslifes 10 місяців тому

    you are the best 'teacher', Mynda, out of all MVPs

  • @kltzy
    @kltzy Рік тому

    Wasn't familiar with the ME functionality. Thanks Mynda, a good push in the right direction.

  • @IvanCortinas_ES
    @IvanCortinas_ES 3 роки тому

    Thank you for this tutorial Mynda. I am already waiting this function in my Excel 365. That's a very powerful function!

  • @gheorghebidiac2975
    @gheorghebidiac2975 3 роки тому +3

    As you said: "mind bending"! :D

  • @sunnybaggu785
    @sunnybaggu785 Рік тому

    Your explanations, presentation and instructions are very good and interesting. Thank you for sharing excel tips this way. IAM sure many people like get to learn from your videos. Thank you..

    • @MyOnlineTrainingHub
      @MyOnlineTrainingHub  Рік тому +1

      So nice of you to say so, Sunny! Thank you.

    • @sunnybaggu785
      @sunnybaggu785 Рік тому

      @@MyOnlineTrainingHub thank you madam, apart from youtube, we try to follow and get updates from your email subscription and LinkedIn too.

  • @ricos1497
    @ricos1497 3 роки тому +1

    Nice, I like the use of ME, I might try that. The bit I struggle with is how to bail on complex recursive functions, maybe where you've added a counter or whatever. Even in your example, it's not completely obvious how returning 1 in the IF() statement actually causes the function to return 120 (and not 1). That's the bit I struggle with when writing out recursion with more than one parameter, and when let gets involved and so on. I've actually written a couple where I added in another cntr variable, and a text variable that passed back the "state" of variables in the LET function and the counter, so I could effectively see which loop the thing broke on!

    • @Excelambda
      @Excelambda 3 роки тому +1

      Haha, you are everywhere. Is very simple to understand how recursive works, (why is 120 and not 1), because only after finds the base case, the 1, has all the terms to conclude the calculation .
      for example fact(4) computer > 4 * fact(3) > 4*3*fact(2) > 4*3*2*fact(1) >condition met fact(1) =1 > 4*3*2*1 bam result 24
      That's the idea of recursive, never leaves the calculation , continues because it calls itself but finishes only when it has all the terms known.

    • @ricos1497
      @ricos1497 3 роки тому +1

      @@Excelambda Yes, that's a great way of explaining it! When I said it wasn't completely obvious, I meant to the layperson. It's a concept that doesn't exist elsewhere in Excel, and doesn't quite explain itself, so if you're looking at a recursive function, it's difficult to get by just looking at it. I'll steal your explanation for when I have to explain it to others!

  • @samaruti9446
    @samaruti9446 9 місяців тому

    Mynda, you have a great way of taking something complex and making it simple to understand, Can you please do the same with the ME parameter?

    • @MyOnlineTrainingHub
      @MyOnlineTrainingHub  9 місяців тому

      Thanks for your kind words! I know what you mean about the ME parameter. I'll add it to the list 😁

  • @DougHExcel
    @DougHExcel 3 роки тому

    Great example! LAMBA could replace some VBA scripting so it's good to know

  • @darrylmorgan
    @darrylmorgan 3 роки тому

    Hi Mynda!Great Tutorial.Very Interesting Plus Nice And Easy To Understand...Thank You :)

  • @chrism9037
    @chrism9037 3 роки тому +1

    Wow. Time for an Advil, Mynda!

  • @sktneer
    @sktneer Рік тому +1

    Another way to do this is as below...
    Assuming the number is in A2, then to find the factorial of the number in A2, we may use the following formula directly in the cell.
    In B2
    =REDUCE(1,SEQUENCE(A2),LAMBDA(n,r,n*r))

  • @abdelkrimmesaiahmed662
    @abdelkrimmesaiahmed662 3 роки тому

    Thank you for this amazing video

  • @mohammedahmed8295
    @mohammedahmed8295 3 роки тому

    Appreciate your efforts

  • @realpulsecoin
    @realpulsecoin 3 роки тому

    Great content!

  • @ItzAsgharHussain
    @ItzAsgharHussain 3 роки тому +1

    Hi, in my excel workbook I have 200+ sheets & sheet names defined.
    Every sheet contains data like student name father name address and mob no.s
    if I enter sheet name I should get all the data in that particular sheet

    • @MyOnlineTrainingHub
      @MyOnlineTrainingHub  3 роки тому

      Unfortunately, the structure of the file goes against best practice, so any way you approach this will be a workaround. I recommend you use Power Query (ua-cam.com/video/L4BuUzccLpo/v-deo.html) to consolidate the data into the correct tabular format: www.myonlinetraininghub.com/excel-tabular-data-format

    • @ItzAsgharHussain
      @ItzAsgharHussain 3 роки тому

      ​@@MyOnlineTrainingHub Thanks for reply, I've seen the video and your website, I have my data in one workbook and in that I have 200+ sheets (tabs). The data is well defined and in good format. All I want is, in the index sheet (tab), if I enter the sheet(tab) name I should get the data present in that particular sheet(tab). Just like vlookup. I watched all your vlookup videos and liked it, In vlookup the lookup value is a cell, I get one cell data from different sheet, here the lookup value should be sheet name & I want all cells data or multiple cell data from different sheet by entering sheet name.

    • @MyOnlineTrainingHub
      @MyOnlineTrainingHub  3 роки тому

      I understand what you want, but formulas are not suitable. You should fix the data layout and then you can use Slicers to filter the data to show what you want.

    • @ItzAsgharHussain
      @ItzAsgharHussain 3 роки тому

      @@MyOnlineTrainingHub Ok mam understood, thanks a lot

  • @JoseAntonioMorato
    @JoseAntonioMorato 3 роки тому

    I really liked the explanation of the possibility of testing the recursive LAMBDA using the LET function 👍, but this is not very simple to use. 🤔
    I inform you that the download file link was missing. 😊

    • @MyOnlineTrainingHub
      @MyOnlineTrainingHub  3 роки тому

      Thanks, Jose. Not much about LAMBDA is easy. It's an advanced technique, but hopefully you can adapt the examples to your own formulas. I've added the link now. Sorry about that.

    • @JoseAntonioMorato
      @JoseAntonioMorato 3 роки тому

      @@MyOnlineTrainingHub It is an advanced technique, but with the help of videos like yours, little by little we will be able to understand. Thankful. 🤗

  • @George-lp3qb
    @George-lp3qb Рік тому

    Also they need to come up with a solution for the argument IntelliSense, otherwise, in my opinion, VBA UDF is still better especially that it is application level

  • @GeertDelmulle
    @GeertDelmulle 3 роки тому

    That ME parameter must be something special, because defining recursive LAMBDAs as a local variable in LET normally doesn't work in my experience.
    Good to know. Thanks.

    • @GeertDelmulle
      @GeertDelmulle 3 роки тому

      Hey Mynda,
      Here's a little challenge for you: another famous example for recursion (ever since the Middle Ages) are the Fibonacci numbers: F(n)=F(n-1)+F(n-2). It leads to the concept of the Golden Ratio.
      Can you show us how to create a recursive LAMBDA for this and calculate, for instance, Fibonacci(55)?
      While you're at it, maybe you want to do this both in Excel using a recursive LAMBDA and in Power Query as well, since you know so well how to calculate recursive things in the most efficient way in PQ-M...
      Are you up for the challenge?

    • @MyOnlineTrainingHub
      @MyOnlineTrainingHub  3 роки тому +1

      Hi Geert! Fellow MVP Liam Bastick has written about using LAMBDA for Fibonacci here: www.sumproduct.com/news/article/lambda-formulaic-recursion-its-all-about-me

    • @GeertDelmulle
      @GeertDelmulle 3 роки тому

      @@MyOnlineTrainingHub Ah! you're so lazy! LOL! :-)
      Just kidding. Yes, he got it right and linearized the calculation (the default 'trap'-implementation actually has a Fibonacci series for the calculation time itself, so you do not want to use that.)
      BTW: you don't need a double IF, so his formula can be simplified further, ever so slightly.
      FYI, you can check out the Mr.Excel Message Board in the LAMBDA section for other implementations (we didn't use the ME function there).

  • @johannes3020
    @johannes3020 3 роки тому

    Hello, I have a problem: I'm trying to make a stock price chart show the points at which I've purchased the stock. Would you know how to do this? My attempts fail since the dynamic arrays conflict with each other. Thanks if you'll devote some time to helping.

    • @MyOnlineTrainingHub
      @MyOnlineTrainingHub  3 роки тому

      Hi Johannes, please post your question and sample Excel file on our forum where we can help you further: www.myonlinetraininghub.com/excel-forum

  • @ZaneRinke
    @ZaneRinke 4 місяці тому

    Mynda, Help! Surely one can use Lambda and it's recursive nature to create a Goal-Seek function. All searches fall short.

    • @MyOnlineTrainingHub
      @MyOnlineTrainingHub  4 місяці тому

      I imagine so, but I don't have any tutorials I can point you to and I suspect Goal Seek is more efficient.

    • @ZaneRinke
      @ZaneRinke 4 місяці тому +1

      Thank you for responding.
      Normally, I would use goal seek, but here we are talking about hundreds of lines, with changing variables. I was hoping for a formula based solution.

  • @drsteele4749
    @drsteele4749 3 роки тому

    Does the fact you're using LAMBDA cause your cursor to jump down one cell after every entry, forcing you to move it up every time?

  • @TheEXCELGURU
    @TheEXCELGURU 3 роки тому

    Hi there, i don't see the download link

  • @romulusmilea2747
    @romulusmilea2747 2 роки тому

    One question about 3:30 moment: then name was defined, you did not put the = sign before that IF, on the Refer to field. Excel users who used/created named formulas in the past, or even simple names did use = sign. Why this detail was not explained ? I have observed that many Excel experts on UA-cam are in competition with each other, who can explain faster, and faster, details do not matter, the ultimate goal is to be as quick as possible. This is not teaching, it is just speeding. However, you do not seem to be one of them, but still I do not understand why explanation about that = sign is missing (surprisingly, on 5:21 the equal sign was used). Thank you.

    • @MyOnlineTrainingHub
      @MyOnlineTrainingHub  2 роки тому

      Hi Romulus, the formula does include the equals sign, it's just that the formula is long and you're only seeing the second line in the name manager. If you notice the formula I copy from the cell at 3:18 includes the equals sign.

  • @abdelkrimmesaiahmed662
    @abdelkrimmesaiahmed662 3 роки тому

    Mynda there is no link to download the excel file

  • @micheleradogna4921
    @micheleradogna4921 3 роки тому

    Can i use factorial for obtain a list? For example, if i want a list with all the number, between 5 and 1(4,3,2,1). Once for a Row.
    *5*
    4
    3
    2
    1

    • @MyOnlineTrainingHub
      @MyOnlineTrainingHub  3 роки тому +1

      Hi Michele, you can use the SEQUENCE function for this: www.myonlinetraininghub.com/excel-sequence-function

  • @RR-fv2uu
    @RR-fv2uu 3 роки тому

    can u help me

    • @MyOnlineTrainingHub
      @MyOnlineTrainingHub  3 роки тому

      You can post your question and sample Excel file on our forum where we can help you further: www.myonlinetraininghub.com/excel-forum

  • @beegdigit9811
    @beegdigit9811 Рік тому

    Excel has become a functional programming language lol