Index Match across worksheets with criteria

ChemistryBMS

New Member
Joined
Jul 7, 2023
Messages
6
Office Version
  1. 2013
Platform
  1. Windows
Hi All,

Apologies if the title doesn't explain my query best, but I have data in separate worksheets and want to create a search filter with set criteria. Cell A2 is a data validation list to select the desired test. Cell B2 is the select the mathematical operator for greater or less than. Cell C2 for a numeric value to be entered manually.

Sample finder snapshot.xlsx
ABCDEFGHIJKLMNOP
1TestOperatorValueSample IDResultLocationI am aiming to make an automatic population of sample IDs with result and location in the open table. We can pull data from our IT system and it provides the data in the templates seen in the other worksheets. The yellow tab is the archiving position for each sample. The blue test filter should look in the worksheet 'CALCIUM' The green operator filter is to distinguish a greater or less than The orange value is to set the value the table should look against With this filter on, the values that should come back are: - 123459 | 2.9 | RACK 4 POS 2 - 123460 | 3.0 | RACK 4 POS 4
2CALCIUM>2.6
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Finder
Cells with Data Validation
CellAllowCriteria
A2List='Criteria filters'!$A$2:$A$3
B2List='Criteria filters'!$C$2:$C$3


The samples have archive positions seen in this table (worksheet 'Archive position'). I want to return the values in column I (result).
Sample finder snapshot.xlsx
ABCDEFGHIJKL
1Last nameFirst nameBirth dateSexSampleTestAnalyserResult datetimeResultUnitRequest departmentRequest physician code
2PATIENT 1TEST01/01/2000M123456ARCHIVEMANUAL ARCHIVE01/07/2023 12:00RACK 1 POS 3A&EDR TEST
3PATIENT 2TEST02/01/2000M123457ARCHIVEMANUAL ARCHIVE02/07/2023 12:00RACK 2 POS 1A&EDR TEST
4PATIENT 3TEST03/01/2000M123458ARCHIVEMANUAL ARCHIVE03/07/2023 12:00RACK 3 POS 5GPDR TEST
5PATIENT 4TEST04/01/2000M123459ARCHIVEMANUAL ARCHIVE04/07/2023 12:00RACK 4 POS 2GPDR TEST
6PATIENT 5TEST05/01/2000M123460ARCHIVEMANUAL ARCHIVE05/07/2023 12:00RACK 4 POS 4A&EDR TEST
Archive position




Tests have their lab number and results in another worksheet, named the same as the test. This worksheet would be titled 'CALCIUM'.
Sample finder snapshot.xlsx
ABCDEFGHIJKL
1Last nameFirst nameBirth dateSexSampleTestAnalyserResult datetimeResultUnitRequest departmentRequest physician code
2PATIENT 1TEST01/01/2000M123456CALCIUMANALYSER 101/07/2023 12:002.5MMOL/lA&EDR TEST
3PATIENT 2TEST02/01/2000M123457CALCIUMANALYSER 202/07/2023 12:002.6MMOL/lA&EDR TEST
4PATIENT 3TEST03/01/2000M123458CALCIUMANALYSER 303/07/2023 12:002MMOL/lGPDR TEST
5PATIENT 4TEST04/01/2000M123459CALCIUMANALYSER 404/07/2023 12:002.9MMOL/lGPDR TEST
6PATIENT 5TEST05/01/2000M123460CALCIUMANALYSER 505/07/2023 12:003.1MMOL/lA&EDR TEST
CALCIUM


I have uploaded from my personal PC on 365 but need the formula(s) to be compatible with my work version (office 2013).

Thanks, ChemistryBMS

Also asked here Index match with filters
 
Last edited by a moderator:

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
How about
Sample finder snapshot.xlsx
ABCDEFG
1TestOperatorValueSample IDResultLocation
2CALCIUM>2.61234592.9RACK 4 POS 2
31234603.1RACK 4 POS 4
4   
5   
6   
7   
8   
9   
10   
11   
12   
13   
14   
15   
16   
17   
18   
19   
20   
Finder
Cell Formulas
RangeFormula
E2:E20E2=IFERROR(INDEX(INDIRECT("'"&$A$2&"'!E:E"),AGGREGATE(15,6,ROW(INDIRECT("'"&$A$2&"'!I2:I100"))/(IF($B$2="<",INDIRECT("'"&$A$2&"'!I2:I100")<$C$2,INDIRECT("'"&$A$2&"'!I2:I100")>$C$2)),ROWS(E$2:E2))),"")
F2:F20F2=IFERROR(INDEX(INDIRECT("'"&$A$2&"'!I:I"),AGGREGATE(15,6,ROW(INDIRECT("'"&$A$2&"'!I2:I100"))/(IF($B$2="<",INDIRECT("'"&$A$2&"'!I2:I100")<$C$2,INDIRECT("'"&$A$2&"'!I2:I100")>$C$2)),ROWS(E$2:E2))),"")
G2:G20G2=IF(E2="","",INDEX('Archive position'!$I$2:$I$100,MATCH(E2,'Archive position'!$E$2:$E$100,0)))
Cells with Data Validation
CellAllowCriteria
A2List='Criteria filters'!$A$2:$A$3
B2List='Criteria filters'!$C$2:$C$3
 
Upvote 0
Solution
Hi Fluff,

Many thanks for the prompt response and working that back into my original document worked the first time.

We also have values where the measurement is below a limit. See below in the image, what would be the best way to omit this data?

image


Thanks, ChemistryBMS
 
Upvote 0
Do you just want the 3rd row returned?
 
Upvote 0
Yes, plus values that have the > / < applied too, therefore row 7 would be returned too.

However, if I change B2 to <, the results of <3 would return.
 
Upvote 0
The problem is values such as >120000 and <3 are text & not numbers & so it's no simple matter to test whether they are greater then (or less than) a particular value.
 
Upvote 0

Forum statistics

Threads
1,223,887
Messages
6,175,199
Members
452,617
Latest member
Narendra Babu D

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