2 answers
Please try below code. Please modify field name according to your org. OR
(
AND
(
NOT( ISBLANK(Opportunity__c) ),
NOT( ISBLANK(Case__c))
),
AND(
ISBLANK(Opportunity__c) ,
ISBLANK( Case__c )
)
)
Please make this as solution if this will help you.