Please check the attached file of input. I like to have the mentioned output using some formula if possible in excel. Please help