[SalesForce] How to write a formula using both a picklist and a checkbox

I've added a picklist field "Lease_Lease_Assign_Applicable__c" with the choices being "Yes" or "No". There is a checkbox field "Lease_Assignment_Received__c" that I will also use. This field has been used for a few years so I can't change the field type. I'm trying to write a formula for a third field (Text) that will give me "NA" if Lease/Lease Assign Applicable is "No" and "Checked or Yes/Unchecked or No" as applicable. Below is the formula I've tried and the error message I received. I'm guessing there is an issue with converting a checkbox field to text. Any suggestions are greatly appreciated!

IF(ISPICKVAL(Lease_Lease_Assign_Applicable__c, “Yes”), TEXT(Lease_Assignment_Received__c), “NA”)
Error: Syntax error

Best Answer

There's a few ways to write this. You'll need a logical condition test for the checkbox field rather than TEXT().

In this example, the AND() function is used to make sure all of those conditions are true. If they're all true, it displays "Yes", otherwise "NA".

IF (
    AND(
        ISPICKVAL( Lease_Lease_Assign_Applicable__c, "Yes" ),
        Lease_Assignment_Received__c
    ),
    "Yes",
    "NA"
)

Update to address the comment: another IF statement is needed to evaluate the second condition.

IF (
    ISPICKVAL( Lease_Lease_Assign_Applicable__c, "Yes" ),
    IF ( Lease_Assignment_Received__c, "Yes", "No" ),
    "NA"
)