Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

vlookup using 2 cols as criteria

Posted on 2011-02-18
9
Medium Priority
?
343 Views
Last Modified: 2012-06-27
Excel 2003 - I have one  spreadsheet with 3 sheets.
sheet 1 is called 2011 contribs
sheet 2 is called 403 election
sheet 3 is called tds earnings

I need a formula to lookup earnings from sheet 3 and put on sheet 1.  The problem is that I need the formula to match 2 cols in sheet 3 with 2 cols in sheet 1 before returning earnings.
I need to match up emp (employee nbr) AND ppe (Pay period ending date) from sheet 3 and return the earnings onto sheet 1.  I would appreciate any suggestions.  Please see attached.

If emp_nbr
for-experts-2.xls
0
Comment
Question by:jph826
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
9 Comments
 
LVL 24

Accepted Solution

by:
StephenJR earned 1000 total points
ID: 34926753
If only one line for each, this perhaps;

=SUMPRODUCT(('TDS earnings'!A2:A25='2011 contribs'!A2)*('TDS earnings'!B2:B25='2011 contribs'!G2)*('TDS earnings'!C2:C25))
0
 
LVL 50

Assisted Solution

by:barry houdini
barry houdini earned 1000 total points
ID: 34926852
A lookup formula would also work, i.e.

=LOOKUP(2,1/(A2='TDS earnings'!A$2:A$100)/(G2='TDS earnings'!B$2:B$100),'TDS earnings'!C$2:C$100)

Advantages over SUMPRODUCT

would also work if the value to be returned is text
can't sum multiple values (if more than one row matches it returns data from the last one)

Disadvantages

Gives an error (rather than zero) if there is no matching row (although the formula could be modified to avoid that)

regards, barry
0
 

Author Comment

by:jph826
ID: 34926917
Thanks a lot to you both!  Both formulas work but stop working at row 77 and return 0 for the rest of the spreadsheet which is 13,000 rows.  What am I doing wrong?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 24

Expert Comment

by:StephenJR
ID: 34926939
In mine, I should have locked the references - could that be it?

=SUMPRODUCT(('TDS earnings'!A$2:A$25='2011 contribs'!A2)*('TDS earnings'!B$2:B$25='2011 contribs'!G2)*('TDS earnings'!C$2:C$25))

However, Barry did so not sure!
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 34926950
Can you post the exact formula you used? You need to use $ signs in the ranges to stop those changing as you copy down (as I have done with 'TDS earnings'!A$2:A$100, for example)

barry
0
 

Author Comment

by:jph826
ID: 34927212
I'm sorry, I must be doing something wrong.  I can get them both to work but only up to a certain point.  Then one formula returns 0 and the other returns NA.  I'm attaching the whole file and so appreciate your help!
for-experts-all-data-2.xls
0
 
LVL 24

Expert Comment

by:StephenJR
ID: 34927246
You needed to update the ranges to cover all data in the third sheet:

=SUMPRODUCT(('TDS earnings'!A$2:A$22264='2011 contribs'!A2)*('TDS earnings'!B$2:B$22264='2011 contribs'!G2)*('TDS earnings'!C$2:C$22264))
0
 

Author Comment

by:jph826
ID: 34929974
Thank you both so much.  Both formulas worked and I actually used one to validate the other.  I'm splitting the points between you.  Is there a way for me to remove the attachment?
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 34930038
If you hit the "Request Attention" button a moderator may be able to remove the attachment for you

regards, barry
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question