IfElse Question - Total Sum if Dropdown = Yes


Sorry to ask such a simple question but how would i write the below into Sugar?

Its relating to the Proposal line items. I have a cost, buy and margin field which calculates all of the Proposal line items. But i need another field called "in Forecast"- If this is selected as Yes then i want my new field to calculate only the buy price of lines that have the dropdown = Yes.