Understand complex syntax in calc

I’m trying to convert a complex formulated Calc file into a python program and database. I want to understand it’s syntax better. Is there any tool to understand the syntax better?
For example, one of it’s functions is this:

=IF(AND(G$8>=$C$309;G$8<=$D$309);$M$309;(IF(AND(G$8>=$C$310;G$8<=$D$310);$M$310;(IF(AND(G$8>=$C$311;G$8<=$D$311);$M$311;(IF(AND(G$8>=$C$312;G$8<=$D$312);$M$312;(IF(AND(G$8>=$C$313;G$8<=$D$313);$M$313;(IF(AND(G$8>=$C$314;G$8<=$D$314);$M$314;(IF(AND(G$8>=$C$315;G$8<=$D$315);$M$315;(IF(AND(G$8>=$C$316;G$8<=$D$316);$M$316;(IF(AND(G$8>=$C$317;G$8<=$D$317);$M$317;(IF(AND(G$8>=$C$318;G$8<=$D$318);$M$318;n)))))))))))))))))))

I want to understand what it is doing.

Perhaps viewing it with the function wizard, is more understandable.

I think what it does is return the column M value for the first value in column C equal or greater than G8.

Hi

With another tool you can get intermediate calculations.
Principle is to select the relevant part of the formula and then press the F9 key. The result is displayed in a tooltip.
This works both in the formula bar and in-place editing of the cell.
A short video shows this feature. It is in French but the demonstration should remain understandable.

Regards