Instead of writing our every group for which you want to generate a formula, you can let the Formula Builder collect all group names that occur in the “Input Groups” cells. The output will be in alphabetical order.
This is a companion discussion topic for the original entry at https://www.xltoolbox.net/formulabuilder.html