Pregunta de entrevista de Tata Consultancy Services

given a problem and ask me to write the function in ms excel.