Calculations & filtering data inside an array

Westbury

Board Regular
Joined
Jun 7, 2009
Messages
139
I have geographic data in a spreadsheet, cols A to J and many rows. Cols H & I contain decimal latitude and longitude. I know how to read this data into an array but would like to know the efficent way of of performing calulations and filtering the data inside the array.

I already have an equation to calculate distances from a fixed point for each of the rows [using the lat and long] but need to

1) "add" an extra column to the array to accommodate this result for each row
2) to filter the results to exclude rows where the distance is < X and >Y
3) to add a further "column" to the array to accommadate the compass bearing of the fixed point to the point identified in each row. (which is a separate problem as the equation uses MOD(Atan2.... which doesn't seem to work in VBA)

I know how to do the calculations but would appreciate some advice on how to use the array for these needs.

Thanks
Geoff
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,144,164
Messages
5,722,855
Members
422,461
Latest member
kelleys315

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
Top