Hi Astouding, thanks a lot for your help, you idea is very good but unfortunately my table contain monthly data for 8 years (201101-201801), which makes the code too long, I have found a simpler method: create a Key=Scenario||Measure (concatenate), then I dropped the scenario variable and performed a transpose to have the measures in coulmns and applied my formulas. I transposed back my data. thank you very much for your help. Kind regards. Toufik
... View more