Can anybody solve the logic in attachment. I have tried using Sum ,if, where and in function but getting error message.