Deductions & credits

Can Turbo tax handle these calculations of apportioning the gains?

 

Are there any tax payers who have gone through filing under these circumstances?