I am still a little new to excel but adapt at coding. My issue I have an excel database as follows

columns are

Product Type
Customer ID
Red
Blue
Yellow

it is setup so that we are selling flowers the value for several flowwers under product type would be tulip or rose then we have an ID # for the each order which is the Customer ID which is a Unique ID so therefore there could be several orders for roses say 5 orders each with its own Customer. Then each customer orders a specific number of each color.

Now that you kind of have an idea what the setup is I am trying to write a formula that will sum the number of red roses within the whole sheet on to a seperate sheet for inventory purposes so it needs to add together all the red flowers that have a product ID of rose and using a similar principle i need to count the number of customers that order Red Roses.

This main issue is the order sheet gets sorted by different fields alot so we need a way to dynamicaly sum and count based on a unique field or array.

This is a crude example i tried to simplify it as much as possible.

any assistance with this would be appriciated thanks