Hello everyone ,
I would like to get your help for the following:
This table shows the items that have been purchased during the year. My objective is calculate how many we saved when we purchased each item (I'm trying to compare each time the price of the last purchase with the current one).
[TABLE="class: outer_border, width: 500, align: center"]
<tbody>[TR]
[TD]Purchase Order[/TD]
[TD]Date[/TD]
[TD]Item[/TD]
[TD]Quantity[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]A156[/TD]
[TD]12/01/2018[/TD]
[TD]A[/TD]
[TD]12[/TD]
[TD]1.2[/TD]
[/TR]
[TR]
[TD]A597[/TD]
[TD]05/02/2018[/TD]
[TD]B[/TD]
[TD]5[/TD]
[TD]25.1[/TD]
[/TR]
[TR]
[TD]A856[/TD]
[TD]01/03/2018[/TD]
[TD]D[/TD]
[TD]6[/TD]
[TD]13.75[/TD]
[/TR]
[TR]
[TD]A251[/TD]
[TD]28/04/2018[/TD]
[TD]E[/TD]
[TD]2[/TD]
[TD]150[/TD]
[/TR]
[TR]
[TD]A987[/TD]
[TD]30/04/2018[/TD]
[TD]A[/TD]
[TD]1[/TD]
[TD]0.95[/TD]
[/TR]
[TR]
[TD]A302[/TD]
[TD]12/05/2018[/TD]
[TD]C[/TD]
[TD]10[/TD]
[TD]89.57[/TD]
[/TR]
[TR]
[TD]A201[/TD]
[TD]25/06/2018[/TD]
[TD]B[/TD]
[TD]9[/TD]
[TD]22.65[/TD]
[/TR]
[TR]
[TD]A875[/TD]
[TD]19/07/2018[/TD]
[TD]A[/TD]
[TD]7[/TD]
[TD]0.75[/TD]
[/TR]
[TR]
[TD]A935[/TD]
[TD]21/08/2018[/TD]
[TD]E[/TD]
[TD]3[/TD]
[TD]135[/TD]
[/TR]
[TR]
[TD][TABLE="width: 172"]
<tbody>[TR]
[TD]A156[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]11/09/2018[/TD]
[TD]C[/TD]
[TD]5[/TD]
[TD]89.57[/TD]
[/TR]
[TR]
[TD]A307[/TD]
[TD]23/10/2018[/TD]
[TD]D[/TD]
[TD]15[/TD]
[TD]11.5[/TD]
[/TR]
</tbody>[/TABLE]
I tried to get the first purchase date for each item and the price :
[TABLE="width: 500"]
<tbody>[TR]
[TD]Item[/TD]
[TD]First purchase date[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]12/01/2018[/TD]
[TD]1.2[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]05/02/2018[/TD]
[TD]25.1[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]01/03/2018[/TD]
[TD]13.75[/TD]
[/TR]
[TR]
[TD]E[/TD]
[TD]28/04/2018[/TD]
[TD]150[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]30/04/2018[/TD]
[TD]0.95[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]12/05/2018[/TD]
[TD]89.57[/TD]
[/TR]
</tbody>[/TABLE]
I put in the 2nd column :
=MIN(IF(Tableau1[Item]=Feuil2!A2;Tableau1[Date])) (Ctrl+Shift+enter)
And for the last column :
=SUMIFS(Tableau1[Unit Price];Tableau1[Item];Feuil2!A2;Tableau1[Date];Feuil2!B2)
I need to go back again to my initial table to calculate the price difference between each line and the last purchase price to see how we save each time.
The problem is I need to know how we saved when the item is repeated for the 3rd time, for example item 'A' we saved (1.2-0.95=0.25)
I need to capture the next saving which is (0.95-0.75=0.2); the same thing for all the lines on my initial table.
Is there a way to do it only with formulas or do I need to use VBA coding ?
Thank you in advance.
I would like to get your help for the following:
This table shows the items that have been purchased during the year. My objective is calculate how many we saved when we purchased each item (I'm trying to compare each time the price of the last purchase with the current one).
[TABLE="class: outer_border, width: 500, align: center"]
<tbody>[TR]
[TD]Purchase Order[/TD]
[TD]Date[/TD]
[TD]Item[/TD]
[TD]Quantity[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]A156[/TD]
[TD]12/01/2018[/TD]
[TD]A[/TD]
[TD]12[/TD]
[TD]1.2[/TD]
[/TR]
[TR]
[TD]A597[/TD]
[TD]05/02/2018[/TD]
[TD]B[/TD]
[TD]5[/TD]
[TD]25.1[/TD]
[/TR]
[TR]
[TD]A856[/TD]
[TD]01/03/2018[/TD]
[TD]D[/TD]
[TD]6[/TD]
[TD]13.75[/TD]
[/TR]
[TR]
[TD]A251[/TD]
[TD]28/04/2018[/TD]
[TD]E[/TD]
[TD]2[/TD]
[TD]150[/TD]
[/TR]
[TR]
[TD]A987[/TD]
[TD]30/04/2018[/TD]
[TD]A[/TD]
[TD]1[/TD]
[TD]0.95[/TD]
[/TR]
[TR]
[TD]A302[/TD]
[TD]12/05/2018[/TD]
[TD]C[/TD]
[TD]10[/TD]
[TD]89.57[/TD]
[/TR]
[TR]
[TD]A201[/TD]
[TD]25/06/2018[/TD]
[TD]B[/TD]
[TD]9[/TD]
[TD]22.65[/TD]
[/TR]
[TR]
[TD]A875[/TD]
[TD]19/07/2018[/TD]
[TD]A[/TD]
[TD]7[/TD]
[TD]0.75[/TD]
[/TR]
[TR]
[TD]A935[/TD]
[TD]21/08/2018[/TD]
[TD]E[/TD]
[TD]3[/TD]
[TD]135[/TD]
[/TR]
[TR]
[TD][TABLE="width: 172"]
<tbody>[TR]
[TD]A156[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]11/09/2018[/TD]
[TD]C[/TD]
[TD]5[/TD]
[TD]89.57[/TD]
[/TR]
[TR]
[TD]A307[/TD]
[TD]23/10/2018[/TD]
[TD]D[/TD]
[TD]15[/TD]
[TD]11.5[/TD]
[/TR]
</tbody>[/TABLE]
I tried to get the first purchase date for each item and the price :
[TABLE="width: 500"]
<tbody>[TR]
[TD]Item[/TD]
[TD]First purchase date[/TD]
[TD]Price[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]12/01/2018[/TD]
[TD]1.2[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]05/02/2018[/TD]
[TD]25.1[/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD]01/03/2018[/TD]
[TD]13.75[/TD]
[/TR]
[TR]
[TD]E[/TD]
[TD]28/04/2018[/TD]
[TD]150[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]30/04/2018[/TD]
[TD]0.95[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]12/05/2018[/TD]
[TD]89.57[/TD]
[/TR]
</tbody>[/TABLE]
I put in the 2nd column :
=MIN(IF(Tableau1[Item]=Feuil2!A2;Tableau1[Date])) (Ctrl+Shift+enter)
And for the last column :
=SUMIFS(Tableau1[Unit Price];Tableau1[Item];Feuil2!A2;Tableau1[Date];Feuil2!B2)
I need to go back again to my initial table to calculate the price difference between each line and the last purchase price to see how we save each time.
The problem is I need to know how we saved when the item is repeated for the 3rd time, for example item 'A' we saved (1.2-0.95=0.25)
I need to capture the next saving which is (0.95-0.75=0.2); the same thing for all the lines on my initial table.
Is there a way to do it only with formulas or do I need to use VBA coding ?
Thank you in advance.