@ThinhDinh has a very good tutorial on the topic of arrayformulas. It’s quite old, but still relevant, I think.
If you ever need to do this again, here are a couple of methods that can be used with Glide Tables:
Fair enough