How to add "if" function in condition?