![]() Note: Although "range" means a different, very common thing in Excel and VBA – a range of cells – it is not a reserved word in VBA and you can call your custom function RANGE. ![]() ![]() This gives the same result as =MAX(A1:15)-MIN(A1:A15) With this function defined in VBA, we can now use it in a spreadsheet to calculate range more simply: =RANGE(A1:A15) ' Calculates range (maximum - minimum) of data However, with some basic VBA, we can create our own custom function that would work just like that. Unfortunately, there is no built-in RANGE function in Excel. We could just use a formula like this: =RANGE(A1:A15) Range is so commonly needed, it is surprising there is no built-in RANGE function in Excel, which would make the calculation easier than the formula above. If you subtract the minimum from the maximum, you get range (61). The second part, MIN(A1:15), finds the lowest value (14). The first part of the formula, MAX(A1:A15), finds the highest value in the data (75 in the screenshot above). In Excel you can calculate range using the functions MIN and MAX.įor example, if you have your data in cells A1 to A15, you can calculate range in a single formula: =MAX(A1:15)-MIN(A1:A15) Range is the difference between minimum and maximum value in a dataset.
0 Comments
Leave a Reply. |