Hi, I am having trouble figuring out how to combine SUMIF and VLOOKUP. I have a large table with a list of names in column A, then various numbers and statistics associated with each name in the remaining columns. I want to add the numbers in a couple of columns, but only for some of the names in column A. The logic I'm trying to use is to sum the number in column B if the name in column A appears in a list on a different sheet.
Example:
A - B - C
Allen - 10 - 14
Bob - 15 - 12
Charlie - 18 - 13
David - 3 - 42
Edward - 19 - 3
Frank - 2 - 20
Second sheet list:
Bob
Charlie
Frank
So I would like to create a forumula that will sum the numbers in column B if the name in column A shows up in the smaller list. If it worked correctly, the formula would add only column B's values for Bob, Charlie, and Frank for a total of 35. How do I go about this?
-Tom
Last edited by NBVC; 11-23-2010 at 12:52 PM.
Try:
=SUMPRODUCT(SUMIF(Sheet1!A1:A6,A1:A3,Sheet1!B1:B6))
where the original data is in Sheet1A1:B6 and the short list is in sheet2, A1:A3
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Maybe this:
=SUMPRODUCT(--($A$1:$A$6=Sheet2!$A$1)+($A$1:$A$6=Sheet2!$A$2)+($A$1:$A$6=Sheet2!$A$3), $B$1:$B$6)
EDIT:
Ooh, like NBVC's so much better.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Thanks NBVC, that worked great and was much simplier than trying to insert a complex VLOOKUP formula into a simple SUMIF formula!
-Tom
This is a new question actually...will start a new thread since this one is solved already.
-Tom
Last edited by ride_op; 12-06-2010 at 07:52 PM. Reason: Deleting to start new thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks