i know that but you still needed to know how to correctly post code and why you got emojis.

Are you saying the two IIf() statements cause failure? What does "failure" mean - error message, wrong result, nothing happens?

Might provide your workbook for analysis. Follow instructions at bottom of my post.