This simple formula can help you decide whether it's smarter to repair or replace your HVAC system.