How to calculate the range of values in each of a group of data columns

horsechamp

New Member
Joined
Jan 6, 2014
Messages
2
I had a group of data columns and I needed to determine the difference between the maximum and minimum values for each column. Since I have never written a macro in excel, I manually individually sorted the values in each column to put the highest value in the first row and the lowest value in the last row and then I entered a cell formula to subtract the last row value from the first row value for each column. This worked but there must be an easier and more elegant way to do this using a macro. What is a better way to do this?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
No need for a macro - you can use the MIN and MAX functions to create a formula.

If your list of values is in cells A1-A5, use the formula:

=MAX(A1:A5)-MIN(A1:A5)
 
Upvote 0

Forum statistics

Threads
1,214,793
Messages
6,121,617
Members
449,039
Latest member
Mbone Mathonsi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top