I want to format RIGHT cells based on specific cells' value in a row

For example, in the picture, in row 1 I set: A1 = A, D1 = B and G1 = C then right cells of them will be formatted in different format. 

In this same row, when we change position of A, B, C to another cell the format will be change accordingly.

I could not do on my own, sadly...:)!
Sample formating:  

[![Sample formating](https://i.stack.imgur.com/vW49Y.png)](https://i.stack.imgur.com/vW49Y.png)