Flatten List Python Using Nested If In Excel