Hi, hope you are doing fabulous.
I have rich experience in Google sheets inbuilt and customized function. We can achieve this just by using inbuilt function in Google sheets or by using Google app script, however you want.
I hope, this definitely make sense.
Thanks & regards,
Sanjay.