in reply to appending values based on criteria

Welcome to the Monastery, logeshwaran!

When cross-posting a question to multiple sites, it's polite to advise that you've done so, so that people can review your other posts to see if answers have already been provided.