Next the formula for f x. For example you may have one rule for all the negative numbers another rule for numbers bigger. In MS-Excel a straight line is created which connects two known values and thereby future value is calculated using simple mathematics formula or using FORECAST.
The first stage is to assign two adjacent columns for the values of x and f x.
The following image shows how to create the y-values for this equation in Excel using the range of 1 to 10 for the x-values. Lets take a look at how to perform this analysis on some real data. For step functions stepfun mentioned by KenWIlliams and approxfun both work well. Moreover we can see how Piecewise Functions can help us to establish rules for common step functions such as the Greatest Integer Function.