The sum of multiple returns on a vlookup

A

Alibo

I am trying to get the sum of multiple returns on a VLOOKUP. As an example:

Jan 24
Jan 57
Jan 239
Feb 72
Mar 16
Mar 44

I want to get a result that looks like:

Jan Feb Mar
320 72 60

I have tried:

=SUMPRODUCT(VLOOKUP((Jan,A2:B7,2,FALSE))

But unfortunatley that just returns 24.

I hope someone can help.

Alibo
 
T

T. Valko

Use SUMIF...

Assume D2:F2 = Jan, Feb, Mar (as TEXT entries)

Enter this formula in D3 and copty across to F3:

=SUMIF($A2:$A7,D2,$B2:$B7)
 
S

Shane Devenshire

Hi,

You really should use SUMIF but here is the correct SUMPRODUCT formula

=SUMPRODUCT(($A2:$A14=D1)*$B2:$B14)

Where Jan is in D1 and you want to copy from left to right.
 
X

xlmate

Hi

VLOOKUP will return the first match
it found. To perform summing a range
with a criteria, there are a couple of
ways doing it.
Here one way :
=SUM(IF($A$2:$A$7=C1,$B$2:$B$7,0))
where C1 is the cell you enter Jan

Pls note that this an array formula,
which you must confirm by Ctrl,Shift and Enter
together. There is a curly bracket {...}
around the formula

If your data os sort as in your example,
another easlier way is to use the SubTotal
in Excel via Data pin the menu bar,
Select Subtotals
Choose Date>> then Sum>> Checked col B

HTH
--
Your feedback is very much appreciate, pls click on the Yes button below if
this posting is helpful.

Thank You

cheers, francis
 

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