Search() and Sumproduct()
Using search() alongside sumproduct()
Lets break it down..
You want to learn Google Apps Script?
Learning Apps Script, (and transitioning from VBA) are covered comprehensively in my book, Going Gas – from VBA to Apps script.
Read more about Quirky functions