Link to home
Start Free TrialLog in
Avatar of Karen Schaefer
Karen SchaeferFlag for United States of America

asked on

Lookup and if statements or index Match on several columns

I am looking for the correct syntax to lookup the value of the Salary for certain employees where Resource Type = "Salaried/W-2"

if the Names match, same date and resource type is correct then return the salary value / 12 months.
this what I have so far.

=IF([@Resource]=SalaryDetail_Data!A:A,IF([@Dates]=SalaryDetail_Data!C:C,IF([@ResourceType]="Salaried/W-2",SalaryDetail!D:D)/12))

What am I missing?

K
sample.xlsm
Avatar of byundt
byundt
Flag of United States of America image

Your sample workbook does not match the formula you say isn't working. I tried to patch it (the workbook) up, and am using the following formula:
=IFERROR(IF([@ResourceType]<>"Salaried/W-2","",LOOKUP(2,1/(([@Resource]=SalaryDetail_Data!A:A)*([@Dates]=SalaryDetail_Data!C:C)),SalaryDetail_Data!D:D)/12),"")

If the above formula doesn't work in your real workbook, could you please make a Table where you want the formula to go, and add a worksheet SalaryDetail_Data so I can test the looking up.

Note that if a name occurs more than once in SalaryDetail_Data, the last salary found will be returned.
sample-1Q28929389.xlsm
ASKER CERTIFIED SOLUTION
Avatar of byundt
byundt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Karen Schaefer

ASKER

thanks that did the trick