Build vs. Buy Calculator

Should you build an internal tool? Or just buy it?