lookup logic to interrogate specific exceptions - part 2

bdav1216

New Member
Joined
Mar 19, 2016
Messages
37
Office Version
  1. 2016
Platform
  1. Windows
Hello,

If (Col B) Manager is equal to: Brian OR Mike OR Shawn then, using the grade field (Col A) output the corresponding average value associated in Sheet2 (Col D and E)

If (Col B) Manager is equal to: Julie OR Sharon OR Liz then, using the grade field (Col A), output the corresponding average value associated in Sheet2 (Col A and B).

If the Grade (Col A) value is blank OR Manager (Col B) is equal to NONE, then output a '-' in the expected value column.

Below I made examples to hopefully help
In Sheet2, under the look up values, I have the assoicated manager names listed.

Sheet 1:

Col A Col B Col C
GradeManagerExpected Results
A01Brian30
A02Julie20
A03Brian80
A04Julie50
A02Mike60
A04Sharon50
A04Mike90
A02Shawn90
A03Liz40
blank value-
A01NONE-

<colgroup><col><col><col></colgroup><tbody>
</tbody>


Sheet 2

Col A Col B Col D Col E
GRADEAverageGRADEAverage
A0110.0P0130.0
A0220.0P0260.0
A0340.0P0380.0
A0450.0P0490.0
julishawn
sharonmike
lizBrian

<colgroup><col width="64" span="5" style="width:48pt"> </colgroup><tbody>
</tbody>
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Maybe...

C2 copied down
=IF(AND(A2<>"",B2<>"NONE"),INDEX(IF(ISNUMBER(MATCH(B2,Sheet2!$A$7:$A$9,0)),Sheet2!$B$2:$B$5,IF(ISNUMBER(MATCH(B2,Sheet2!$D$7:$D$9,0)),Sheet2!$E$2:$E$5)),MATCH(A2,Sheet2!$A$2:$A$5,0)),"-")

M.
 
Upvote 0
Maybe...

C2 copied down
=IF(AND(A2<>"",B2<>"NONE"),INDEX(IF(ISNUMBER(MATCH(B2,Sheet2!$A$7:$A$9,0)),Sheet2!$B$2:$B$5,IF(ISNUMBER(MATCH(B2,Sheet2!$D$7:$D$9,0)),Sheet2!$E$2:$E$5)),MATCH(A2,Sheet2!$A$2:$A$5,0)),"-")


M.


Thank you!
This does appear to be working, but the names (a7-a9 and b7-b9 in sheet2) won't actually be present in my real data - that was just for this example.
How could this be updated to refer the lookup to the correct table based on the names (Brian, Mike or Shawn) would go the values Column D / E of Sheet2 and Julie, Sharon or Liz would go to Column A/B of Sheet 2.

If (Col B) Manager is equal to: Brian OR Mike OR Shawn then, using the grade field (Col A) output the corresponding average value associated in Sheet2 (Col D and E)

If (Col B) Manager is equal to: Julie OR Sharon OR Liz then, using the grade field (Col A), output the corresponding average value associated in Sheet2 (Col A and B).

If the Grade (Col A) value is blank OR Manager (Col B) is equal to NONE, then output a '-' in the expected value column.
 
Upvote 0
Maybe...

=IF(AND(A2<>"",B2<>"NONE"),INDEX(IF(OR(B2={"Brian";"Mike";"Shawn"}),Sheet2!$E$2:$E$5,IF(OR(B2={"Julie";"Sharon";"Liz"}),Sheet2!$B$2:$B$5)),MATCH(A2,Sheet2!$A$2:$A$5,0)),"-")

M.
 
Upvote 0
Maybe...

=IF(AND(A2<>"",B2<>"NONE"),INDEX(IF(OR(B2={"Brian";"Mike";"Shawn"}),Sheet2!$E$2:$E$5,IF(OR(B2={"Julie";"Sharon";"Liz"}),Sheet2!$B$2:$B$5)),MATCH(A2,Sheet2!$A$2:$A$5,0)),"-")

M.

Very nice! It appears to be functionally working now on my data, just need to review.

One minor update:

How would I add one additional check within the first part of that statement to say if B2 was equal to "Steve" also output a '-' value (in addition to what is already present).

=IF(AND(A2<>"",B2<>"NONE"),INDEX(IF(OR(B2={"Brian";"Mike";"Shawn"}),Sheet2!$E$2:$E$5,IF(OR(B2={"Julie";"Sharon";"Liz"}),Sheet2!$B$2:$B$5)),MATCH(A2,Sheet2!$A$2:$A$5,0)),"-")
 
Upvote 0
=IF(AND(A2<>"",B2<>"NONE",B2<>"Steve"),INDEX(.....),"-")

M.
 
Last edited:
Upvote 0
Thank you! I will review and provide any additional feedback if needed. Much appreciated!
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,572
Members
448,972
Latest member
Shantanu2024

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