Forum Discussion
INDEX-MATCH multiple results based on one cell, to fill horizontally in same row
- Oct 26, 2022
=IFERROR(INDEX(NSGP_Pull!$D$3:$D$425, SMALL(IF((NSGP_Pull!$E$3:$E$425=$C2) * ( NSGP_Pull!$F$3:$F$425=$F2), ROW(NSGP_Pull!$D$3:$D$425)-MIN(ROW(NSGP_Pull!$D$3:$D$425))+1), COLUMNS($C$2:C2))),"")
This works in my sheet. Enter the formula with ctrl+shift+enter if you don't work with Office365 or Excel 2021.
byohojcu so, I figured out this problem by adding a COLUMNS function at the end of the statement, and introducing a SMALL IF with ROW functions.
Current formula:
{=IFERROR(INDEX(NSGP_Pull!$D$3:$D$425, SMALL(IF(NSGP_Pull!$E$3:$E$425=$C2, ROW(NSGP_Pull!$D$3:$D$425)-MIN(ROW(NSGP_Pull!$D$3:$D$425))+1), COLUMNS($C$2:C2))),"")}
Now, I'm stuck because I realize that I actually want to INDEX based on 2 conditions for an IF statement, and when I attempt to use AND, it doesn't allow me to autofill the formula/array as such.
For example, I want this:
{=IFERROR(INDEX(NSGP_Pull!$D$3:$D$425, SMALL(IF(AND(NSGP_Pull!$E$3:$E$425=$C2, NSGP_Pull!$F$3:$F$425=$F2 ROW(NSGP_Pull!$D$3:$D$425)-MIN(ROW(NSGP_Pull!$D$3:$D$425))+1), COLUMNS($C$2:C2))),"")}
Or, I want the formula to check that BOTH $C2 and $F2 match with their ranges in sheet NSGP_Pull before giving me a result.
Can anyone assist?
Thanks!
-Blake
=IFERROR(INDEX(NSGP_Pull!$D$3:$D$425, SMALL(IF((NSGP_Pull!$E$3:$E$425=$C2) * ( NSGP_Pull!$F$3:$F$425=$F2), ROW(NSGP_Pull!$D$3:$D$425)-MIN(ROW(NSGP_Pull!$D$3:$D$425))+1), COLUMNS($C$2:C2))),"")
This works in my sheet. Enter the formula with ctrl+shift+enter if you don't work with Office365 or Excel 2021.
- byohojcuOct 27, 2022Copper ContributorAmazing, thank you! I am slowly starting to better understand the numerical values behind the formulas, so multiplying by the other value was so new to me. Solved -- so grateful for your help!