0
votes

Trying to get a simple VLOOKUP to work but only getting first value.

Sample Data

TABA

     V
1
2    1
3    X

X = =SUM(VLOOKUP(V2,TABB!$K:$M,3,FALSE))

TABB

     K  L      M
1    1  Hello  45
2    8  Hello  30   
3    1  Hello  20
4    6  Hello  60
5    1  Hello  90
6    3  Hello  10
7    1  Hello  80
8    1  Hello  75

Current Output

=SUM(VLOOKUP(V2,TABB!$K:$M,3,FALSE))

Is returning 45 (the first value).

Expected Output

=SUM(VLOOKUP(V2,TABB!$K:$M,3,FALSE))

I want it to return 310 (the SUM of values that match 1).

1
You can use : =SUMIF(TABB!K1:K8,A2,TABB!M1:M8) or =SUMPRODUCT((TABB!M1:M8)*(TABB!K1:K8=A2)) - Mrig

1 Answers

1
votes

Vlookup can only return the first value.

In your TABB Sheet. Create another column in Column N e.g in N1 with

=SUMIF($K$1:$K$8,$K1,$M$1:$M$8)

Drag the formula down

Then do

Vlookup(V2,TABB!$K:$N,4,FALSE)

If this works can you please vote up. :) All the best