please see the following pic and i want to convert this formula in SQL Server. in excel sheet
M N
15 1 0 16 3 1 17 5 2 18 8 4 1