v-lookup, match, index combo to return 1 of 3 diff types of statuses

dcotex

New Member
Joined
Jul 31, 2017
Messages
5
I'm looking for 1 of the 3 types of statuses (Not Started, Pending, Approved) according to the project ID, project Name, and the current phase Define (in header) from worksheet 1 and value to be returned in worksheet 2



Worksheet 1 - formula in cell C2
ABC
Column HeadersProject ID #Project NameDefine QA Status
310122Money Service?

<tbody>
</tbody>
Looking for "Approved" in cell C2


Worksheet 2 - Source Data
ABCD
Project IDProject NameStatusPhase
310126AML CardApprovedDefine
310126AML CardNot StartedExpand
310122Money ServiceApprovedDefine
310122Money ServicePendingExpand
310122Money ServiceNot StartedDefine Yr End

<tbody>
</tbody>

*"Define Yr" End is not the same as "Define", looking for status of "Define" only.*


So, to reiterate, in worksheet 1 cell C2, looking to return the "Approved" Status for Define for Project 310122 Money Service.


Appreciate any assistance!



-DCotex
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Try this for a start

=INDEX('Worksheet 2'!$C$2:$C$6,MATCH(1,INDEX(('Worksheet 2'!$A$2:$A$6=A2)*('Worksheet 2'!$B$2:$B$6=B2)*('Worksheet 2'!$D$2:$D$6="Define"),0),0))

Will need more detail on how you get the 'Phase' out of the header in C1, for now "Define" is hard coded in the formula.
 
Upvote 0
A similar formula:

=LOOKUP(1,1/((Sheet2!$A$2:$A$6=A2)*(Sheet2!$D$2:$D$6=LEFT($C$1,SEARCH(" QA",$C$1&" QA")-1))),Sheet2!$C$2:$C$6)

I assumed I didn't need to look for both A2 and B2, since they appear to have a 1-1 relationship. I also was unsure how you wanted to get "Define" from the C1 cell, I used the LEFT(SEARCH construct to find whatever's on the left of QA.
 
Upvote 0
Hmm, you both may be right, what if I edited the column headers accordingly, it will ultimately include other phase types, for which I will need to return the statuses of each, I added another column for insight. So ultimately I am looking for "Approved" in cell C2 and "Pending" in cell D2 in worksheet 1...


Worksheet 1 - edited
ABCD
Column HeadersProject ID #Project NameDefineExpand
310122Money Service??

<tbody>
</tbody>
 
Upvote 0
Great, then you can just put the cell reference there instead of the hard coded "define"

=INDEX('Worksheet 2'!$C$2:$C$6,MATCH(1,INDEX(('Worksheet 2'!$A$2:$A$6=A2)*('Worksheet 2'!$B$2:$B$6=B2)*('Worksheet 2'!$D$2:$D$6=C$1),0),0))
 
Upvote 0
A similar adjustment to my formula:

=LOOKUP(1,1/((Sheet2!$A$2:$A$6=$A2)*(Sheet2!$D$2:$D$6=C$1)),Sheet2!$C$2:$C$6)

place in C2 and drag down and to the right as needed.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,559
Messages
6,125,517
Members
449,236
Latest member
Afua

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