A polynomial can pretty accurately fit piecewise functions.
Excel can do a polynomial up to 6 degrees (x^6 - x^5 . . . . ) The higher the degree polynomial the better the fit.
I used a 6 degree polynomial for the case you described in your posting, and came up with an R^2 value pretty close to 1. Check out the attached files and see if this helps you.