DATA SECTION:

RESULT SECTION

I'm using Google Spreadsheets and have a table in another sheet. I would like to have a formula (placed in the cells like the one labeled [=?]) that gives me sums like thus:

TYPE YES NO
Bat [=?] [=?]
Cow 20 80
Pig 30 30

But I still need the formula.

PROBLEM SECTION

I'm struggling. I want a formula in the results table that looks up in the data section for a match in type and SUMs the Ys for that type. I would like another formula that looks up in the data section for a match in type and SUMs the Ns for that type. I assume VLOOKUP or HLOOKUP, but I'm struggling getting the SUM in addition. I linked an example sheet here.

ADDITIONAL EDITS AFTER THE POST

I don't need a query. I just need a formula that replaces the [=?] for each column in the result section. I just put a ton of info there as an example.

So, I trust this is the answer, but I don't understand it. Can you explain?
–
DorjeMar 15 '13 at 15:50

Actually, I realize what happend. I need a formula for to replace the cell marked [=?] not a query that reformats the data. The data will be a long list of rows and I need a different order than what is show. I just used those as an example.
–
DorjeMar 15 '13 at 15:55

@Dorje Thanks for your feedback !! I've altered my answer as well. I hope this is the answer you're looking for. Have you noticed, both table are the same?
–
Jacob Jan TuinstraMar 15 '13 at 18:02

1

This is it! Thanks so much for the answer and the care in explaining it. I appreciate it.
–
DorjeMar 19 '13 at 13:30