How do I get the sum of vlookup?

J

jiffy

I have 4 worksheet each with over 80 rows of information.

I want to lookup a code in one column, and if found I want the value from
the immediately adjacent column pulled out and added up eg:

code value
a 1.00
b 2.00
a 5.03
c 0.45
d 1.20
a 2.50

so that if I looked up "a" in the first column, it would add 1.00, 5.03 and
2.50 from the second column and spit out a total for me.

I want this to complete the same function on all 4 worksheets and get me the
total value from all worksheets for each code.

I've tried various function combinations of IF, VLOOKUP, SUM etc and can't
seem to get anything to return a result other than error. please help!
 
O

OssieMac

=SUMIF(A2:A7,"=a",B2:B7)

Lookup SUMIF function in Help for more info on using this function.
 
J

Jacob Skaria

Hi "jiffy"

=SUMIF(A:A,"a",B:B)
will give you the sum for the current sheet

For getting sum from multiple sheets try the below. Assuming your sheets are
named Sheet1,Sheet2,Sheet3,Sheet4 etc; then

=SUMPRODUCT(SUMIF(INDIRECT("'Sheet"&ROW(INDIRECT("1:4"))&"'!A1:A100"),"a",INDIRECT("'Sheet"&ROW(INDIRECT("1:4"))&"'!B1:B100")))

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top