I have 2 sheets in same Excel.

First excel sheet contains the following fields

 No       Material           10th july  11th july
  1   DATUM DCP ESD Black                    
  2   DATUM DCP ESD Blue         

My second worksheet contains the following fields

No     Date             Material            Stock size+Wastage
  1  10th july      DATUM DCP ESD Black          283.47 
  2  10th july      DATUM DCP ESD Black          661.6
  3  11th july      DATUM DCP ESD Blue           665.6  
  4  11th july      DATUM DCP ESD Black           50.8

I want the following Expected result in the first worksheet:-

 No      Material             10th july  11th july
  1   DATUM DCP ESD Black      945.07    50.8         
  2   DATUM DCP ESD Blue                 665.6

I pondered this one and don't see any macro to work this since you wrote "copy" since the value 945.07 is not in the second sheet.

That means you want a report or formula that totals by date and product ID which is a report and/or formula.

This is just me clarifying that it's more than you asked for in your top post.

So, if I was to look into this, I think your skill with VLOOKUP and SUMIF will be tested.
Tutorial, examples at https://www.ablebits.com/office-addins-blog/2014/08/05/excel-vlookup-sum-sumif/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.