Sort or scan the values
Find the minimum and maximum. For 4, 9, 3, 12 and 7, the minimum is 3 and the maximum is 12.
Subtract the extremes
Range = maximum − minimum. In this example, 12 − 3 = 9. Keep the measurement unit if the data has one.
Know which meaning you need
In statistics, range commonly describes this spread. In a question about functions, range instead means the set of possible output values. Read the context before using the subtraction rule.