Is it possible to format programmatically in LibreOffice calc?

I want the input to be sheet 1 of attached file.
I want the output to be sheet 2 of attached file.

Note- In sheet 2, Column B is sorted ascending.
Column D is the Column A rank of the cells.
Column E is the concatenation of A with the rank from Column D.
Column F is the percentile rank of Column D.
Column G is 100 *(1- F)

                        Column I,J,K and L are the corresponding results this time using Column B as the sort key.
                        Column M is the fill color.

                         Chart 1 is the scatter of Column G and A.
                         Chart 2 is the scatter of Column L and B.  
                         Chart 3 is the column chart of Column B. 

Is this possible in LibreOffice?
This type of programming interface would be a very powerful method of interacting with data in LibreOffice.

Input Output.ods (37.1 KB)