Lookup value and return most recent

Gwill1983

Board Regular
Joined
Oct 24, 2018
Messages
124
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I have a list of data that is constantly added to which we use to compare pricing on.

What I am trying to achieve is that a monthly report is pulled showing items order within each calendar month and the price that they cost the last time they were ordered (historical order data is held on another sheet)

My raw data table with the history of orders is setup as below. Table named RawData

1647965123862.png


Column K is equated using formula =TEXT([@[Event Date]],"mmmm/yyyy") to create the monthly report on a second worksheet which is setup as below:

1647965246636.png


Using the dropdowns in B2 & D3 gives the Date Search result which pulls all results through from the RawData which match this in column K. Works perfectly.

In column K & L of the report table, I need to lookup the item no from Column F on the Report from Column F on the RawData table and return the most recent result. I think I have achieved this by using the formula =LOOKUP(2,1/(RawData[[#All],[Item No]]='Customer Info'!F5),RawData[[#All],[Unit Price]]) in K5.

The problem that I am facing is that the most recent result is the one that I am pulling for this report, which is not what I want. In essence I need it to pull the most recent occurence EXCLUDING any results which match the Date Search (February/2022 in this instance) in column K of the RawData table. I am really struggling to work out how to do this.

I hope I have explained this clearly enough, but let me know if more detail is required.

Thanks for any help that you can give!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,223,885
Messages
6,175,180
Members
452,615
Latest member
bogeys2birdies

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