Formula to determine margin

Source: accountingcorner.org