I have huge excel file. Column A has invoices(duplicate rows since each item in the invoice is a row), column B has SKU value of item bought(like 200ml, 300ml etc), column C has the brand bought(like Coca-Cola,Sprite etc) and column D has the no of items bought(like 10,15 etc).



The first table has is the dump file for all invoices and the intems bought

Now i want to find the No. of items bought given the condition that the brand is Coca-Cola, the SKU is 200ml and the invoice no. is XAX1X2X3 and display it in another cell.



Now in the second table, i want to match the invoice with the pack size and brand from first table and put the quantity in the empty cell

So the row that is highlighted in table 2 will show the value 3 cause invoice T1411031400114, pack size 200, brand coca-cola has Qty as 3.

I was thinking of using nested VLOOKUP but cant get the correct formula for it.

Any help will be appreciated.

Regards

Anand


Question: The graph has an Euler tour iff in-degree($v$)=out-degree($v$)
Answer: In a simple cycle the in degree and the out degree are both one, so if we add to some simple cycle another simple cycle at some vertex, the in degree and the out degree of the vertex will increase both by 1. 

You got some wrong concept on $G'$, it is not a complex cycle in fact it doesn't even need to be connected. As we defined cycles in my (algorithmic) dicrete math classes we said that every edge may be traversed at most once so it is not possible that $C$ is a complex cycle which traverses one edge more than once. 

So the idea is more that there must be some complex cycle which passes trough every vertex, because your graph is connected, and if uses every edge it is an euler tour. So we take the complex cycle with most edges, and look at $G'=G-C$, as the in degree of some vertex in $G'$ is the in degree of the vertex in $G$ minus the in degree of the vertex in $C$ and the same for the out degrees the graph $G'$ does still have the property, that the in degrees coincide with the out degrees. But if those degrees aren't all $0$ we could add some cycle to $C$ which would result in some complex cycle with more edges, which is some contradiction to our assumption, that $C$ does have the most edges.