Array Formula Suggestion? INDEX/MATCH

CyrusTheVirus

Well-known Member
Joined
Jan 28, 2015
Messages
749
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

I'm looking for a different way of writing the below formula. The only way I could make it work was by combining it into an IF function...

Basically, I'm trying to make the index/match populate a value ONLY if it meets one of two criteria... the criteria being in cells D1 ("def") and E1 ("ghi")

Entered with or without(?) CSE in cell E4, then copied down to E8...

Code:
=IFERROR(IF(OR(INDEX($B$4:$B$7,MATCH(D4,$A$4:$A$7,0))=$D$1:$E$1),INDEX($B$4:$B$7,MATCH(D4,$A$4:$A$7,0)),""),"")

ABCDE
1defghi
2
3
4coreyabccoreyblank = formula
5derekdefadamghi = formula
6adamghichrisblank = formula
7joshjkljoshblank = formula
8derekdef = formula

<tbody>
</tbody>


Also curious exactly​ why the formula works with or without using CSE...?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi.

Perhaps (non-CSE):

=IFERROR(LOOKUP(1,0/(LOOKUP(1,0/(A$4:A$7=D4),B$4:B$7)=D$1:E$1),D$1:E$1),"")

Regards
 
Upvote 0
Your formula without CSE:


Excel 2013 32 bit
ABCDE
1defghi
2
3
4coreyabccorey
5derekdefadamghi
6adamghichris
7joshjkljosh
8derekdef
9
Sheet18


In E5 use this without CSE:

Code:
=IFERROR(IF(SUMPRODUCT(--(INDEX($B$4:$B$7,MATCH(D4,$A$4:$A$7,0))=$D$1:$E$1))>0,INDEX($B$4:$B$7,MATCH(D4,$A$4:$A$7,0)),""),"")

Your formula requires CSE because of the following red part:

Code:
[COLOR=#333333]=IFERROR(IF(OR([/COLOR][COLOR=#ff0000]INDEX($B$4:$B$7,MATCH(D4,$A$4:$A$7,0))=$D$1:$E$1[/COLOR][COLOR=#333333]),INDEX($B$4:$B$7,MATCH(D4,$A$4:$A$7,0)),""),"")[/COLOR]

 
Last edited:
Upvote 0
In E4 just enter and copy down:

=IFERROR(LOOKUP(9.99999999999999E+307,SEARCH($D$1:$E$1,VLOOKUP(D4,A:B,2,0)),$D$1:$E$1),"")
 
Upvote 0
Hi XOR LX,

That works! Thanks for the help. I've never actually used the LOOKUP function. I'll have to learn about it.
 
Upvote 0

Forum statistics

Threads
1,215,473
Messages
6,125,018
Members
449,203
Latest member
tungnmqn90

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