Show most recent value within column (furthest row down)

ronie85

Board Regular
Joined
Jan 25, 2014
Messages
101
Office Version
  1. 365
Platform
  1. Windows
Hi, I have built a stock list for which part numbers are in Column B (ITEM CODE) and purchase price is in Column E (PURCHASE PRICE).
Values increase over time therefore I require when an item is booked out to search for the most recent (lowest) value within Column E (PURCHASE PRICE), and add this to that row within Column M (BOOKED OUT PRICE).
However if the value is to show in M500, it cannot use a value from 501 and up, as when a new price is included, it will change all previous booked out prices. (I suppose I can lock the starting cell and not the final cell)

Therefore Cell M500 has to search for a part number within B1 to B500 and show the value within the same row between E1 and E500.
 
There is a confusion.
For I89 price is E89 as per your explanation.
Or do you mean most recent from E2 to E88.
I89 is just a quantity that is booked out, it doesnt need to form part of the required formula.

If a part number is inserted into B89 but B89 does not have a buy price in E89, but the part number also appears in B3, B18 and B30 for which each of them 3 do have buy prices, the formula is to search B2 to B89 for the part number for which it will appear 4 times in B3, B18, B30 and B89, and search E2 to E89 for the most recent buy price which will be in E30 as it exceeds E3 and E18, but because E89 doesnt contain a price.
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
If a part number is inserted into B89 but B89 does not have a buy price in E89, but the part number also appears in B3, B18 and B30 for which each of them 3 do have buy prices, the formula is to search B2 to B89 for the part number for which it will appear 4 times in B3, B18, B30 and B89, and search E2 to E89 for the most recent buy price which will be in E30 as it exceeds E3 and E18, but because E89 doesnt contain a price.
Does this do what you want?

24 11 02.xlsm
BEN
1Item Code
2Code 911
3Code 1077
4Code 8N/A
5Code 107
6Code 107
7Code 1055
8Code 277
9Code 91
10Code 4N/A
11Code 166
12Code 105
13Code 533
14Code 53
15Code 105
16Code 422
17Code 53
18Code 16
19Code 733
20Code 45555
21Code 105
22Code 73
23Code 105
24Code 744
25Code 3N/A
26Code 27
27Code 27
28Code 16
29Code 766
30Code 76
ronie85
Cell Formulas
RangeFormula
N2:N30N2=TAKE(FILTER(E$1:E2,(B$1:B2=B2)*(E$1:E2>0),"N/A"),-1)



If this is not what you want, could you post a smallish but representative set of sample data with XL2BB after hiding all the irrelevant columns.
Could you then fill in the expected results manually and post the sheet again with XL2BB and explain a few of the results with specific reference to the sample data?

(If you have trouble with XL2BB, review the "XL2BB Icons greyed out" link in the 'Known XL2BB issues' section near the top of the XL2BB Instructions page linked above.)
 
Upvote 0
Solution
In M2
Excel Formula:
=MAP(B2:B999,E2:E999,I2:I999,LAMBDA(a,b,c,IF(c="","",IF(b<>"",b,IFERROR(INDEX($E$2:b,LARGE(IF($B$2:a=a,ROW($E$2:b)-1,""),2)),"")))))
 
Upvote 0
It would be good for helpers to know what works great as you have been given two quite different suggestions & they cannot both work. ;)
The =TAKE(FILTER(F$1:F774,(B$1:B774=B774)*(F$1:F774>0),"N/A"),-1) formula works great
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,114
Members
453,021
Latest member
Justyna P

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