Hi everyone,
New to this board. I am a research biologist and I have an interesting problem. I am collecting location data on an animal species with overlapping detection methods: radio telemetery and trapping. Now, the telemetery locations are daily locations for a number of animals, and the traps are only in the field for a short period of time before they are moved. My question is how many telemetery locations for each animal are within a set distance from the trap durring the time that the trap is opperational.
My data structure:
I have 2 sheets, one for the telemetry locations, one for the traps and analysis.
The telemetry sheet has columns for Animal ID, Date, Easting, Northing (Eastings and Northings are spatial coordinates).
The trap sheet has columngs for Trap ID, Start Date, End Date, Easting, Northing
The analysis part adds columns for each Animal ID to create a large matrix. Thus for each trap ID, you can find out how many times an animal was located within a user defined distance durring the time that the trap was opperational.
Now, I have solved this problem with a sum(if()) array formula, but with the number of telemetery locations (thousands) and traps (hundreds) I have, the spreadsheet takes a good 6 hours to calculate all the cells. So what I want to know is can you think of a way to do this that will be considerably faster?
My formula is something like this:
{=sum(if(Trap!StartDate <= Telemetery!Date(entire column), if(Trap!EndDate >= Telemetery!Date(entire column), if( ((Trap!Easting - Telemetery!Easting(entire column))^2 + (Trap!Northing - Telemtery!Northing(entire column))^2)^.5) <= distance, 1, 0), 0), 0))}
Hopefully that makes some sence to you. The logic is this:
Add 1 for each of the telemetery locations
if(the date of the telemetery locations are greater than the trap start date
and if( the date of the locations are less than the trap end date
and if the telemetery locations are within the set distance of the trap location (calculated with pythagorean)
else add 0
Once again, this works fine, but it is very slow to calculate with large numbers of data points. If anyone knows how to streamline this process, I would be very happy,
Thanks,
EcoKid
New to this board. I am a research biologist and I have an interesting problem. I am collecting location data on an animal species with overlapping detection methods: radio telemetery and trapping. Now, the telemetery locations are daily locations for a number of animals, and the traps are only in the field for a short period of time before they are moved. My question is how many telemetery locations for each animal are within a set distance from the trap durring the time that the trap is opperational.
My data structure:
I have 2 sheets, one for the telemetry locations, one for the traps and analysis.
The telemetry sheet has columns for Animal ID, Date, Easting, Northing (Eastings and Northings are spatial coordinates).
The trap sheet has columngs for Trap ID, Start Date, End Date, Easting, Northing
The analysis part adds columns for each Animal ID to create a large matrix. Thus for each trap ID, you can find out how many times an animal was located within a user defined distance durring the time that the trap was opperational.
Now, I have solved this problem with a sum(if()) array formula, but with the number of telemetery locations (thousands) and traps (hundreds) I have, the spreadsheet takes a good 6 hours to calculate all the cells. So what I want to know is can you think of a way to do this that will be considerably faster?
My formula is something like this:
{=sum(if(Trap!StartDate <= Telemetery!Date(entire column), if(Trap!EndDate >= Telemetery!Date(entire column), if( ((Trap!Easting - Telemetery!Easting(entire column))^2 + (Trap!Northing - Telemtery!Northing(entire column))^2)^.5) <= distance, 1, 0), 0), 0))}
Hopefully that makes some sence to you. The logic is this:
Add 1 for each of the telemetery locations
if(the date of the telemetery locations are greater than the trap start date
and if( the date of the locations are less than the trap end date
and if the telemetery locations are within the set distance of the trap location (calculated with pythagorean)
else add 0
Once again, this works fine, but it is very slow to calculate with large numbers of data points. If anyone knows how to streamline this process, I would be very happy,
Thanks,
EcoKid