Finding the closest value to a given cell within a column, matching 2 variables (a date and an item part number)

Vermilion

New Member
Joined
Jan 30, 2015
Messages
1
Hello, I am using Excel 2010 and I have this issue:

I have an inventory table where I register the entry of products.
Every time there is an entry of product, I should register its part number, the date of the entry, and the most recent day before the current entry.

Therefore, I am looking for a formula that automatically allows me to identify the closest date before the current entry of data I mentioned; however, it should only look within the dates that correspond to the item in the row.

Something like this:


Item
Date
Result
XJanuary-01-01January-01-01
YFebruary-01-01February-01-01
ZMarch-01-01March-01-01
XOctober-01-01July-01-01
XJuly-01-01January-01-01

<tbody>
</tbody>


Then, I want to know the position of the cell which contains my result:

Item
DateResult
XJanuary-01-01B1
YFebruary-01-01B2
ZMarch-01-01B3
XOctober-01-01B5
XJuly-01-01B1

<tbody>
</tbody>


And finally, I want to change the column (for example to column F):

Item
DateResult
XJanuary-01-01F1
YFebruary-01-01F2
ZMarch-01-01F3
XOctober-01-01F5
XJuly-01-01F1

<tbody>
</tbody>


PD. I cannot use a macro, because that function is blocked per company policy.

Any ideas?
Thank you!
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,215,230
Messages
6,123,752
Members
449,118
Latest member
kingjet

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