Forum Discussion
lynxtra
Jul 27, 2024Copper Contributor
Python (preview) in excel
How do I get the result of an if statement into the cell where I've selected the python script to display the result? I've so far used this script, it only displays in the diagnostic preview pane...
lynxtra
Jul 29, 2024Copper Contributor
I don't know if you've read my post right
SergeiBaklan
Jul 30, 2024Diamond Contributor
Let me try again.
How do I get the result of an if statement into the cell where I've selected the python script to display the result
Python script is in cell A2, result shall be show in the same cell, correct?
Here is the starting point
I prefer Python editor
but for simple case we may continue in cell. Code is
Ctrl+Enter, we have Python object with result preview
To return the value select "123 Excel Value" from drop-down in formula bar
Actually the same was in first sample, but using editor.
- lynxtraJul 30, 2024Copper Contributor
Oh now I get you, thanks, now it works
I just needed the code that you gave as in
a = xl(....