I have a main sheet that I'm trying to add up the total costs for animal types that have been billed. So on the Main sheet I have the total of cost by animal type and id (as shown below):
Also, on the Main Sheet is a summary of all the types of animals and gives a total cost of only the ones that have been billed.
In the "Cost Sheet" I have the following information:
so this is what I've come up with and I can't seem to get the correct answer (ie - cat should be 42)
=SUMPRODUCT(--(('Cost'!B2:H272=B16)*('Cost'!H2:H272="yes"))*'Main Sheet'!I30:I300)
Thanks for your help.
Code:
ID Animal total cost
1234 Cat 11
1235 Dog 12.27
1236 Cat 18
1237 Bird 21
1238 Cat 23
Code:
Main Sheet
Summary
Animal Cost
Cat 52
Dog 12.27
Bird 21
In the "Cost Sheet" I have the following information:
Code:
Cost sheet
ID Animal Cost Billed
1234 Cat 5 yes
1235 Dog 5.27 yes
1236 Cat 10 yes
1237 Bird 12 yes
1238 Cat 13 yes
1234 Cat 6 yes
1235 Dog 7 yes
1236 Cat 8 yes
1237 Bird 9 yes
1238 Cat 10 no
=SUMPRODUCT(--(('Cost'!B2:H272=B16)*('Cost'!H2:H272="yes"))*'Main Sheet'!I30:I300)
Thanks for your help.