That's a "linear programming" problem- you want to optimize a linear "object function" subject to linear constraints.

Here, you wish to maximize "the number of products" which is A+ B+ C.

The number of "red blocks" used would be 4A+ 2B+ C, the number of "yellow blocks" used would be 2A+ 4B+ C, and the number of "blue blocks" would be A+ 2B+ 4C.

Now, you say you want to insert the "resource"- those would be the number of each such "blocks" and so would give three linear equations in those variables. If you were to graph those in a "ABC- coordinate system", they would be planes. The "feasible region", the region of all solutions that satisfy those constraints, must lie below all of those planes. Also the "object function", A+ B+ C= various constants would be variousparallelplanes.

The critical point of "linear programming" is that the optimum value of the linear "object function" must occur at avertexof the "feasible region". So you need to set up your excel program to solve the the three equations simultaneously (because there are three equations in three variables, there will be a single solution- there are other vertices where the planes will meet the x= 0, y= 0, and z= 0 planes but those will clearly not give amaximum).