nested sumif

B

boris

I need to sumif into a cell based on two columns'
criteria, with one being a subset of the other and one
dynamically generated.

One column is date, one is an expense type, and the other
is amount.

I want to sum the amount if it is a certain date, and then
within that date, if it is a type of expense. So:

Date Type $
1/1/04 test1 54
1/1/04 test2 25
1/2/04 test1 10
1/2/04 test2 15
1/2/04 test2 5

Should produce, into the following table
A B C
1 Date Test1 Test2
2 1/1/04 54 25
3 1/2/04 10 20

The fact that I will always want Test1's value in column B
and Test2's value in columns C is set. However, the dates
in column A will be generated differently every time,
therefore the sumif for B2, for example, will need to ask
the question "sum all values that have date equal to
whatever is in A2 AND the is of type Test1.

That's the challenge I'm facing.

Thanks for any help.

Boris
 
D

duane

assuming your first table is in cells a1:c5 and your next table will b
in g1:i3

in cell h2

=sumproduct(($g2=$a$1:$a$5)*(h$1=$b$1:$b$5)*($c$1:$c$5))

and copy to h2:i
 

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