Do not try and built a complex formula in one go.
Take it step by step; make LeaveType="Casual Leave" work first..
You have already written down the pseudo code in your description,
Now... best done in Notepad.. rewrite the description into a Formula..
Once you think it might work, paste it into SharePoint... If it fails.. go back to Notepad..
Tip: copy paste each try as a new paragraph in Notepad.. you learn from reviewing previous mistakes.
If Leave Type=Casual Leave
then I have to compare the field casual leave
in PTO Available
and I have to
subtract the calculated days of that particular column
and the result should be
in Current PTO YTD
in Current Casual Leave PTO YTD .
Notes:
- Calculated Columns can not set a value in another Column, you need a Workflow for that