Jun 05 2023 03:26 AM - edited Jun 05 2023 03:27 AM
I have a cell with a dropdown list. I am trying to INDEX MATCH from 2 tables depending on what I select from the dropdown list. Tables are called MAIN_EQUIPMENT and INSTRUMENT_ FIELD. They are located on 'System & FL Codes' tab.
The independent formulas below work, but is there a way to join them together?
MAIN_EQUIPMENT index match formula
=(INDEX('System & FL Codes'!B3:B112,MATCH(Sheet4!E4,MAIN_EQUIPMENT,0)))
INSTRUMENT_ FIELD index match formula
=(INDEX('System & FL Codes'!F6:F466,MATCH(Sheet4!E4,INSTRUMENT_FIELD,0)))
Jun 05 2023 03:51 AM
Which cell contains the drop down list? And what are the choices in that list?
Jun 05 2023 03:58 AM - edited Jun 05 2023 04:00 AM
Sheet4!E4 has the dropdown list. Selections from it are MAIN_EQUIPMENT and INSTRUMENT_ FIELD. I named the tables the same.
The tables are System & FL Codes'!B3:B112 and System & FL Codes'!F6:F466
Jun 05 2023 04:07 AM - edited Jun 05 2023 04:07 AM
I don't understand - you also use Sheet4!E4 as the value to look up in the MATCH part of the formulas.
Can you try to explain in more detail and more clearly what you want to do?
Also: the ranges used in INDEX and MATCH should have the same size.
Jun 05 2023 05:30 AM
Sorry for the confusion.
I have my tables on sheet called 'System & FL Codes'. The tables have been named MAIN_EQUIPMENT and INSTRUMENT_FIELD. The MAIN_EQUIPMENT look-up covers cells B4:B122. The INSTRUMENT_FIELD look-up cells cover cells F6:F466
I have a dropdown list in cell D4 where I can select MAIN_EQUIPMENT or INSTRUMENT_FIELD. This then allows me to select a Function using Data Validation =INDIRECT(D4), i.e. 'Analyser System'.
Sheet4!E4 is the reference cell. If that shows 'Analyser System', then cell I4 returns 'AA' from matching in the table.
The formula in cell I4 is
=(INDEX('System & FL Codes'!F6:F466,MATCH(Sheet4!E4,INSTRUMENT_FIELD,0))) works. (Image above)
If I use the formula
=(INDEX('System & FL Codes'!B3:B112,MATCH(Sheet4!E4,MAIN_EQUIPMENT,0))) than that works for the MAIN_EQUIPMENT list.
My problem is that I want to combine those 2 formulas so that they work with a dropdown list in cell D4.
Jun 05 2023 05:52 AM
I'm still confused. Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?
Jun 05 2023 06:02 AM
Hopefully the attached link will take you to the spreadsheet: https://docdro.id/90NhFD1
Jun 05 2023 06:10 AM
Jun 05 2023 06:40 AM
Jun 05 2023 07:38 AM
Jun 05 2023 07:40 AM
But @SergeiBaklan 's formula doesn't refer to 'System & FL Codes'!B3:B112
Jun 05 2023 07:41 AM
Jun 05 2023 07:45 AM
Jun 05 2023 09:52 AM
Your data validation list is based on
but in Name Manager you have only few of the defined
For not defined names formula gives #REF!, for defined returns value or #N/A if nothing is found.
Jun 05 2023 10:10 AM
To handle errors formula could be
=IF(
ISERROR(ROWS(INDIRECT(D4))),
"no range",
IFERROR(
INDEX(
'System & FL Codes'!F6:F466,
MATCH(Sheet4!E4, INDIRECT(D4), 0)
),
"no such value"
)
)
Jun 05 2023 03:11 PM
Jun 05 2023 11:41 PM
Jun 06 2023 09:42 AM
For the defined names it shall work.
Jun 07 2023 02:28 AM