Search a column for values, return a value from adj column

A

Adam

i want to setup some sort of formula to search a column for specific keywords
(multiple keywords as well) and return a value from an adjacent column
(organizing my expenses), and then add the values up:

example:

A B C D E
1 Jewel 50 65 20 60
2 Dominicks 15
3 Speedway 50
4 Subway 10
5 Wendys 10
6 KFC 10

look in the list, search for jewel and dominicks, return 65 (50 + 15).

look in the list, search for wendys and subway, return 20 (10 + 10).

and then if a value is not technically searched for (just some of misc
value), still return the additive values of each adjacent data. so speedway
and kfc weren't in the formulas, take their adjacent values and add them
together, 60.

there's probably already some sort of checkbook/expenses sheet setup like
this, i just have to find it.
 
A

Adam

to add another twist, the values in the A column will have other words
besides just what i'm searching for
 
B

Bob Phillips

=SUMPRODUCT((A1:A10={"jewel","Dominicks"})*(B1:B10))

=SUM(B:B)-SUMPRODUCT((A1:A10={"jewel","Dominicks","Subway","Wendys"})*(B1:B10))
 

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