Match & Index with specific criteria

drewberts

Board Regular
Joined
Sep 5, 2013
Messages
177
Office Version
  1. 365
Platform
  1. Windows
I'll simplify the problem I'm having with an example.

I have 2 sheets the first (called CLIENTS) has FIRSTNAME, LASTNAME, COMPANY, TYPE, STATUS
The second (called JOBS) has FIRSTNAME, LASTNAME, COMPANY, TYPE, SITE, POSTCODE

The idea is that the first sheet is filled in with clients and in the STATUS column the answer is either YES or NO (I'm trying to differentiate between active and non active clients).
On the second sheet I complete the FIRSTNAME and LASTNAME and the COMPANY and TYPE columns are auto populated from the CLIENT sheet using:-

=INDEX(Clients!$C$8:$C$2300,MATCH($A1&$B1,Clients!$A$8:$A$2300&Clients!$B$8:$B$2300,0))
=INDEX(Clients!$D$8:$D$2300,MATCH($A1&$B1,Clients!$A$8:$A$2300&Clients!$B$8:$B$2300,0))

These both work fine. However what I wan't to introduce now is that they only auto-populate if the STATUS in the CLIENT sheet is set to YES.

Hope that makes sense.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi...

I took the liberty of rearranging your data on one sheet purely for the ease of demonstration purpose:

[TABLE="width: 200"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[TD]L[/TD]
[TD]M[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD]CLIENTS[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]JOBS[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD]FIRSTNAME[/TD]
[TD]LASTNAME[/TD]
[TD]COMPANY[/TD]
[TD]TYPE[/TD]
[TD]STATUS[/TD]
[TD][/TD]
[TD]FIRSTNAME[/TD]
[TD]LASTNAME[/TD]
[TD]COMPANY[/TD]
[TD]TYPE[/TD]
[TD]SITE[/TD]
[TD]POSTCODE[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD][/TD]
[TD]A[/TD]
[TD]D[/TD]
[TD]X[/TD]
[TD]C1[/TD]
[TD]YES[/TD]
[TD][/TD]
[TD]A[/TD]
[TD]D[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD][/TD]
[TD]B[/TD]
[TD]E[/TD]
[TD]Y[/TD]
[TD]C2[/TD]
[TD]NO[/TD]
[TD][/TD]
[TD]B[/TD]
[TD]E[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD][/TD]
[TD]C[/TD]
[TD]F[/TD]
[TD]Z[/TD]
[TD]C3[/TD]
[TD]YES[/TD]
[TD][/TD]
[TD]C[/TD]
[TD]F[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

I entered the following array formulas to conditionally populate:

Company in J6

=IF(INDEX($F$6:$F$8,MATCH(H6&I6,$B$6:$B$8&$C$6:$C$8,0),1)="Yes",INDEX($D$6:$D$8,MATCH(H6&I6,$B$6:$B$8&$C$6:$C$8,0),1),"")

Type in J7

=IF(INDEX($F$6:$F$8,MATCH(H6&I6,$B$6:$B$8&$C$6:$C$8,0),1)="Yes",INDEX($E$6:$E$8,MATCH(H6&I6,$B$6:$B$8&$C$6:$C$8,0),1),"")

Hope this helps.
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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