Question: I have an excel sheet with the list of all the products sold in different years. I need to display separately the total price of the each product that was sold in 2016 only:

[![enter image description here](https://i.stack.imgur.com/xK9id.png)](https://i.stack.imgur.com/xK9id.png)

and I need to get all the prices of the products sold in 2016 ( for each product separately) and create a new table like this

[![enter image description here](https://i.stack.imgur.com/6giC3.png)](https://i.stack.imgur.com/6giC3.png)

So if there are 100 laptops sold over the years, I need to create a new table with total price of the sold laptops in 2016.

I tried to achieve this by using sumif, but I can't figure out how to write correct condition. Any help would be greatly appreciated.

Answer: 
Add anothercolumn to identify the year sold, e.g =year(a2). Create a pivot and filter on the new column.
Here is the SUMIFS formula that escaped you.

```
=SUMIFS($C$2:$C$8,$A$2:$A$8,">"&DATE(G$1,1,0),$A$2:$A$8,"<"&DATE(G$1,12,32),$B$2:$B$8,F3)

```

In the picture below it is in cell F3 from where it can be copied down.

[![enter image description here](https://i.stack.imgur.com/bHGIu.png)](https://i.stack.imgur.com/bHGIu.png)

By simply changing the year in G1 you can get the results for different years. So, you could create a list of all items with a column for each year and see the results side by side.