title: Create macro to count from a sheet and fill the count in a table
body: <h1>Initial Information</h1>
  
  <p>I have sheet1 which has the data with multiple columnn, and I have named the data ranges as well. </p>
  
  <p><a href="https://i.stack.imgur.com/1CFf6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1CFf6.png" alt="enter image description here"></a></p>
  
  <p>My second sheet has kind of a dashboard where I need to put the count according to the values.</p>
  
  <p><a href="https://i.stack.imgur.com/AzE97.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AzE97.png" alt="enter image description here"></a></p>
  
  <h2>I have already Tried</h2>
  
  <ol>
  <li>Countif  - > gave  #VALUE! error</li>
  <li>Countifs - > gave  #VALUE! error</li>
  <li>sumif    - > gave  #VALUE! error</li>
  <li>sum(if(component="Abc",1,0)) - > <strong>Worked</strong>, but since its an array formula i have to press CTRL+SHIFT+ENTER</li>
  </ol>
  
  <p>The problem with the last formula is that each time the data changes in sheet1 i have to go to sheet2 and press CTRL+SHIFT+ENTER on each cell. 
  I need help with a Macro That can do the job. </p>