Forum Discussion

Dylan1G's avatar
Dylan1G
Copper Contributor
Jan 06, 2023

Prevent Name Manager From Duplicating LAMBDA Formulas

Hi!

I've been utilizing LAMBDA custom formulas, and one issue I've encountered is anytime I make a new sheet, or duplicate one, even if the Scope is set to "Workbook", Excel automatically creates a duplicate of the LAMBDA functions with the Scope set to the new sheet. I'm not sure why, and wondering how to stop this. Thank you!

12 Replies

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    I've encountered similar quirks here and there recently with the Name Manager. A few days ago, a dynamic named range (Created with TAKE/COUNTA) had reverted to a static range. I know had defined it because the text of the formula was still on my clipboard. With Lambda, I've had 1 issue where a function I had created needed to be updated. I updated it through name manager and then proceeded to call it in a formula. I received an error then checked the Name manager to find the Lambda update had not been saved (In fact, this quirk happened 3 more times!). My solution was to delete the Lambda and re-add it.

    Perhaps these quirks are due to an environment in which Advanced Formula Environment exists alongside Name manager?

    • Dylan1G's avatar
      Dylan1G
      Copper Contributor

      Was thinking it’s possible it’s because I specified a range in one of the formulas without specifying the sheet. However, I don’t think I did that anywhere. This is a very frustrating bug, assuming it is one and seems to be affecting other aspects too.

      • Patrick2788's avatar
        Patrick2788
        Silver Contributor
        Do you happen to run Advanced Formula Environment? That's the only cause I can think of at the moment. This bug is odd because the Lambdas are stored as named items in Workbook.xml which is not copied when a sheet is copied. Another Sheet[#].xml file is created in the zip package. The sheet xml files contain constants and formulas but no defined names.
  • Dylan1G 

    I haven't seen any such behaviour.  The workbook-scoped names defining Lambda functions remain unaltered whilst the Range references spawn sheet-local copies.

    Perhaps a more detailed example that we can replicate would be in order.

    • Dylan1G's avatar
      Dylan1G
      Copper Contributor

      Just checked with your sheet. It does occur too. It doesn't happen when I add a sheet, but when I duplicate one. Make a copy of any of the sheets and then check the name manager. All of the lambda formulas get duplicated with the scope defined to the new sheet.
      PeterBartholomew1

      • PeterBartholomew1's avatar
        PeterBartholomew1
        Silver Contributor

        Dylan1G 

        The story gets more complicated.  I created the Lambdas first and then made the sheet copy and added a new blank sheet without problem.  Yet when you do the same, the results are different!

        I had wondered whether it could because your Lambdas made explicit reference to worksheet ranges rather than as parameters but that doesn't seem to hold water as a theory.

Resources