Hello adi_h,
Thanks for writing us here in Microsoft Community.
We're glad to hear that you're enjoying using Python in the Excel Beta channel. Regarding your issue with referencing a cell containing a lambda function for a Python calculation, it's possible that the lambda function is not being recognized as a valid input for the Python calculation.
Based on my research, it appears that this is a known issue with the LAMBDA function in Excel. I'll try my best to help you, adi_h, but if it doesn't apply to your issue, it's best if we could seek help from dedicated experts for further guidance.
One option you could try is to convert the lambda function output in cell B17 to a regular value using the "Copy" and "Paste Values" functions. This will replace the lambda function output with a regular value that can be recognized by the Python calculation.
To do this, select cell B17, right-click and select "Copy", then right-click on another cell and select "Paste Values". This will replace the lambda function output with a regular value that can be used in your Python calculation.
Other workaround that you can try is to use a named range instead of a lambda function. Here are the steps:
- Select the cell containing the lambda function.
- Go to Formulas > Define Name.
- In the New Name dialog box, enter a name for the range and select the cell containing the lambda function as the Refers to value.
- Click OK.
- In your Python calculation, reference the named range instead of the cell containing the lambda function.
To learn more about the error encountered, you can also try to check these articles.
If this workaround does not resolve the issue, we strongly recommend you post this to Questions - Microsoft Q&A or Welcome to the Excel Community - Microsoft Community Hub. Experts from these forums are dedicated to help advanced users like you. They will be able to guide you and provide further assistance in addressing the issue.
If you continue to encounter issues, please report them by selecting Help > Feedback in Excel. We will also leave this thread open so that other MVPs and community members can participate.
These are my ways of helping you today. I hope you understand.
Sincerely,
Froilance T.
Microsoft Moderator