Alex Ironside
Alex Ironside

Reputation: 5039

How to lookup and sum with Google Sheets

So I have this spreadsheet

enter image description here

And I want to essentially grab the value to the right of the value.

So for example, if I look for x, I want to get the values of E9, and E15. So far this is my query:

=LOOKUP(D23 , $D$5:$E$16 , $E$5:$E$16 , FALSE)

But all I'm getting is:

Error
Formula parse error

Any idea what I'm doing wrong?

EDIT:

I thought I might be making a mistake, since I forgot I'd have to SUM, but after changing the key to tax it still doesn't work

I tried both LOOKUP and VLOOKUP, same problem in each

I also tried smth I found in a tutorial, but no luck

=VLOOKUP(D23 , $D$5:$E$16 , 2 , FALSE)

TO FUTURE SEARCHERS:

To figure out which "breaker" you need (, of ;), take a close look at the formula help. It's the blue question mark next to the fx

Upvotes: 2

Views: 20163

Answers (2)

Daniel H.
Daniel H.

Reputation: 670

Try using SUMIF (Documentation) instead of LOOKUP or VLOOKUP.

Like so:

=SUMIF(D5:D16;"tax";E5:E16)

Also, as you are using a Polish "Locale", you should use ; instead of ,.

Reasoning: whether you have to use , or ; depends on the "Locale" of the spreadsheet, under File –> Spreadsheet Settings. For example, a US or UK "Locale" would use the former (,) while a Hungarian or Polish "Locale" would use the latter (;)

Upvotes: 9

Mike Steelson
Mike Steelson

Reputation: 15318

You should use SUMIF

=sumif($D$5:$D$16;"x";$E$5:$E$16)

Upvotes: 3

Related Questions