Pulling data from another sheet based on specific criteria

ExcelMonkey89

New Member
Joined
Apr 20, 2022
Messages
2
Office Version
  1. 2016
  2. 2013
  3. 2011
  4. 2010
  5. 2007
  6. 2003 or older
Platform
  1. Windows
Salutations!

I am trying to compile a summary sheet on information regarding the placement of camera-traps at different locations at an ecological research field site. We have multiple camera-trapping stations, each of which has two positions that a camera-trap can be placed in. These stations are serviced on an irregular basis (i.e. the dates are essentially random) and with each service, information about the camera-trap's location is recorded. There are already 3950 service records (covering 138 camera-traps used on-and-off across 29 stations and 58 positions over 11 years) and the database is growing, hence I want to summarise it. The data which I wish to summarise is on a worksheet (Sheet 1) and looks as follows:

A​
B​
C​
D​
1Date servicedStation numberPosition numberCamera-trap
211/11/2016
2​
4​
15
317/11/2016
7​
13​
13
426/11/2016
2​
4​
15
528/11/2016
11​
21​
2
601/12/2016
2​
4​
15
703/12/2016
19​
38​
11
804/12/2016
7​
13​
13
905/12/2016
13​
26​
13
1012/12/2016
11​
21​
2
1114/12/2016
2​
4​
15
1217/12/2016
7​
13​
13
1303/01/2017
8​
15​
2

For each camera-trap unit, there are multiple dates when the camera-trap was checked in the field and the Station number and Position were recorded. I am trying to summarise these records on a separate summary sheet to show the last location that the camera-trap was used (i.e. its most recent station). These data should be summarised on a separate sheet (Sheet 2) which has the following structure:

A​
B​
C​
D​
1Camera-trapLast used/servicedMost recent stationMost recent position
21
32
43
54
6
5​

So, using the example presented in above, for Camera-trap 2, the 'Last used/serviced' would be '03/01/2017', the 'Most recent station' should be '8' and 'Most recent position' should be '15'. I have figured out a formula for the 'Last used/serviced' which works but I need help with the formulae for the 'Most recent station' and 'Most recent position' (I realise that these formulae will be identical but with difference reference ranges, so if you can assist with only the 'Most recent station' one, I will adapt it for the 'Most recent position').

Thank you!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi & welcome to MrExcel.
Which version of Excel are you actually using? It can't really be all those you have listed.
 
Upvote 0
Hi & welcome to MrExcel.
Which version of Excel are you actually using? It can't really be all those you have listed.
You are correct. I am using Excel 2016 but I listed several versions because the file will need to work on multiple machines and I know that we only have up to Office 2016.
 
Upvote 0
So does this need to work with 2003 or older or just 2016?
 
Upvote 0
This will work for 2010 onwards
+Fluff 1.xlsm
ABCD
1Date servicedStation numberPosition numberCamera-trap
211/11/20162415
317/11/20167133
426/11/20162415
528/11/201611212
601/12/20162415
703/12/2016193811
804/12/201671313
905/12/2016132613
1012/12/201611212
1114/12/20162415
1217/12/20167133
1303/01/20178152
Sheet1


+Fluff 1.xlsm
ABCD
1Camera-trapLast used/servicedMost recent stationMost recent position
21   
3203/01/2017815
4317/12/2016713
54   
65   
Sheet2
Cell Formulas
RangeFormula
B2:B6B2=IFERROR(AGGREGATE(14,6,Sheet1!$A$2:$A$13/(Sheet1!$D$2:$D$13=A2),1),"")
C2:D6C2=IFERROR(INDEX(Sheet1!B$2:B$13,AGGREGATE(14,6,(ROW(Sheet1!$A$2:$A$13)-ROW(Sheet1!$A$2)+1)/(Sheet1!$D$2:$D$13=$A2)/(Sheet1!$A$2:$A$13=$B2),1)),"")
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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