title: Create a sorted list from an unsorted list in excel using if and array
body: <p>I got stuck trying to do some organisation in my excel sheet. Hope someone can help me. Thank you. </p>
  
  <p>I know how to use a nested if statement for an array but there's something I am not able to figure out. </p>
  
  <p>I have an unsorted list:</p>
  
  <pre><code>No | ITEM   | Cost | Category 
  #1 | item 1 | $10  |    A
  #1 | item 2 | $30  |    C
  #2 | item 3 | $70  |    A
  #3 | item 4 | $20  |    B
  #4 | item 5 | $50  |    B
  </code></pre>
  
  <p>I want to sort them into 3 seperate list on the right side of the excel sheet. Category A, B and C</p>
  
  <p>Category A</p>
  
  <pre><code>ITEM   | Cost
  item 1 | $10
  item 3 | $70
  </code></pre>
  
  <p>Category B</p>
  
  <pre><code>ITEM   | Cost
  item 4 | $20
  item 5 | $50
  </code></pre>
  
  <p>Category C</p>
  
  <pre><code>ITEM   | Cost
  item 2 | $30
  </code></pre>
  
  <p>What I did initially was to use an array in a nested if statement on the individual cell in the sorted list.</p>
  
  <p>For example, </p>
  
  <pre><code> =IF(D1 : D5="A", B1, "")
  </code></pre>
  
  <p>But it doesn't sort out properly and display error. I have hundreds over items and it is a bit hard to go through them everytime I want to look up something. The list cannot be sorted using the "sort" in excel because I want the unsorted list to be arranged by dates.</p>
  
  <p>Sorry for the trouble, I just need someone to teach me how to do it one of the sorted category and I should figure out the rest on my own. thank you.</p>