ForEachLoop check number of instances of a variable and execute based on amount

Thank you very much again!