Calculated Due Date

Hi,
I’m trying to create a calculated field to derive “Target End Date” based on a combination of the Project attribute and availability of dates.

What I’m trying to do is something like:
If Project in (X, Y, Z) AND Sprint End Date is NOT NULL, then Sprint End Date
Else, If Project in (X, Y, Z) AND Issue Due Date is NOT NULL, then Issue Due Date
Else, If Project in (X, Y, Z), then Fix Version Due Date
Else, If Project not in (X, Y, Z), then Issue Due Date

And have this End date be populated for each issue based on the above criteria on a table.

Apologies in advanced for what could be a basic question, but I’m new to this and hoping the group can help provide guidance.

THANKS!