In reply to Kevin Boone.

I am glad to hear it Kevin. Actually, after you use IFC() for a couple of times it'll feel more intuitive and powerful than if...then...else. Since you "bought one" (IFC function), you get another one (IFN function) for FREE! :)
Also, I had to withdraw this one-liner IFC solution, as it turned out that all three arguments to the IFC and IFN functions are evaluated BEFORE these functions are called, and the results of the evaluation are then passed to the function. In case of P=0, this will still result in NOTE: Invalid second argument to function SUBSTR, see this blog post by Rick Wicklin.