Hello, everyone!
In my workplace we have data like this:
Sheet "Paste"
|
|
Bought |
Sold |
Drinks |
Store1 |
52 |
64 |
Drinks |
Store2 |
23 |
12 |
Candy |
Store1 |
12 |
24 |
Food |
Store1 |
89 |
98 |
Food |
Store2 |
65 |
45 |
Notice how if there was no products bought or sold in one category, it is excluded completely (at the moment this cannot be changed because of our outdated system).
As we have over 100 categories and I want to compare them on a montly basis I need a new page where even this 0-movement-categories are shown.
Sheet "List"
|
|
Bought |
Sold |
Drinks |
Store1 |
52 |
64 |
Drinks |
Store2 |
23 |
12 |
Candy |
Store1 |
12 |
24 |
Candy |
Store2 |
0 |
0 |
Food |
Store1 |
89 |
98 |
Food |
Store2 |
65 |
45 |
Before I start showing my formulas I need to stress that I am more familiar with Calc than Excel, which is probably why I cannot get it to work.
I tried using
=(IF(Paste!$A:$A=List!$A2,1,0)*IF(Paste!$B:$B="Store1",1,0)*Paste!C:C)
and it works until it arrives at a non-existant category where it starts to either find the category or store code to be false. (I alternate the second if clause to be equal to "Store1" or "Store2")
So instead I tried a proper sumproduct function instead:
=SUMPRODUCT((Paste!A:A=List!A2)*(Paste!B:B="Store1")*(Paste!C:C))
but it gives me a #VALUE error, I guess because C:C is not a proper value?
By moving a parenthesis I got good result... until it hit a non-existant category again. It does not skip and return 0, instead it returns the next value in the "Paste"-list.
=SUMPRODUCT((Paste!A:A=List!A2)*(Paste!B:B="Store1"))*(Paste!C:C)
I tried using a lookup-formula to find the proper value, but I guess I am too unfamiliar with it to get it to work.
Any help would be very much appreciated.
- Wolfwinter
Bookmarks