Get last change in price history table

gleblanc

New Member
Joined
May 4, 2012
Messages
4
Hi all,

I am once again asking for your wisdom.

I have one table (only one, with no relationship) showing the price history of products we buy.

The columns are:

IDHistory___IDProduct___ChangeDate___NewPrice
1__________AAA_______2012-01-01____100.00$
2__________AAA_______2012-02-22____110.00$
3__________BBB_______2012-03-01____300.00$
4__________BBB_______2012-04-01____320.00$
5__________CCC_______2012-04-01____500.00$

I need a new calculated column showing for each row the last price change entered for each product; therefore the last price from the vendor for that specific product.

By example, for product AAA, I want to see:

IDHistory___IDProduct___ChangeDate___NewPrice___LastPrice
1__________AAA_______2012-01-01____100.00$____110.00$
2__________AAA_______2012-02-22____110.00$____110.00$

How can I do it ? I'm pretty sure it's simple enough.

Thank you!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
There is probably a better way to do this but for now this should work.

Code:
=SUMX(FILTER(Table1,
             Table1[ChangeDate]=MAXX(FILTER(Table1,
                                            Table1[IDProduct]=EARLIER(Table1[IDProduct],1)),
                                     Table1[ChangeDate]) 
          && Table1[IDProduct]=EARLIER(Table1[IDProduct])),
     [NewPrice])
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,126
Members
452,381
Latest member
Nova88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top