Formula to check if a later purchase has a better/ worse price

qetuo

New Member
Joined
Oct 18, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Dear Excel Overlords,

I am becoming desperate with what appears to be a easy problem but after trying for hours I still can not get the correct output.
I know I could just sort my list to some convenient order and probably get my expected outcome but then as soon as I change the order it will mess up the output.

The Case: I purchase various items at different times for different prices. Now I just want to know if my purchases are improving (lower price over time) or worsening (higher price over time).

For Example:
DateIDPrice
10/02/21B99
03/04/21A12
04/08/21C88
03/06/21A13
10/02/21A14
21/01/21C77

I bought product A three times, now I want to know if the highest price (14, which I can find with "MAXIFS") is also the first purchase. And vice-versa the lowest price (12, "MINIFS") in the best case szenario the last purchase. Next to my list of all purchases I used to UNIQUE Formula to get a list and then countif/averageif/minif/maxif to do some analysis. What I was trying to do is another column with basically some formula with two conditions: 1. ID = A and 2. smallest/biggest date and then give me the output price. With this result I could do some simple comparison, like "IF min>max" or something like that.

Another idea was to have another column next to all purchases to check if there was a previous purchase and if yes if it increased or decreases, but I could not wrap my head around this either.

I am not sure if I am missing the forest through the trees or if this actually requires some complicated formula.

Any help is appreciated.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Here are some things you can do:

MrExcelPlayground4.xlsx
ABCDEFGHI
1DateIDPriceMin PaidMax PaidFirst PaidMost Recent
22/10/2021B99A12141413
34/3/2021A12B99999999
48/4/2021C88C77887788
56/3/2021A13
62/10/2021A14
71/21/2021C77
Sheet21
Cell Formulas
RangeFormula
E2:E4E2=SORT(UNIQUE(B2:B7))
F2:F4F2=MIN(INDEX(SORT(FILTER($A$2:$C$7,$B$2:$B$7=E2),1),,3))
G2:G4G2=MAX(INDEX(SORT(FILTER($A$2:$C$7,$B$2:$B$7=E2),1),,3))
H2:H4H2=INDEX(SORT(FILTER($A$2:$C$7,$B$2:$B$7=E2),1),1,3)
I2:I4I2=INDEX(SORT(FILTER($A$2:$C$7,$B$2:$B$7=E2),1),ROWS(FILTER($A$2:$C$7,$B$2:$B$7=E2)),3)
Dynamic array formulas.
 
Upvote 0
Solution
Thanks. This helps me a lot. Especially the Filter and Sort Formula, no idea why I didn't think about that.
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,391
Members
449,080
Latest member
Armadillos

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