@Malachi, IMHO, I believe your
review comment is incorrect. If you read the first line of the question: "I would like to optimize a snippet of code, which use a multiple nested if statements. I am looking for formula to make it as a combination of multiple arrays logical operations. " This does not ask for "specific review on the if statement inside the for loops", as far as I can tell.