How to place the value from column r in column x or y based on column z and q

I have to place a date value in column X or Y based on input from column Z and G. The date values are located in column R. Column Z and G are text values. Column Z contains 4 categories (flavours) and in column G I have to look (contains) for a certain word. So […]