MrExcel's Learn Excel #615 - Filter Recent II

If you like this content, please consider visiting the video on YouTube and subscribe to the MrExcel Channel to show your support!
This video has been published on Mar 31, 2009.
In todays podcast, I address the same question from podcast 614, but assume that the dataset can not be sorted. This requires a powerful array formula to find the most recent date for each customer. Episode 615 shows you how.

This blog is the video podcast companion to the book, Learn Excel from MrExcel. Download a new two minute video every workday to learn one of the 277 tips from the book!
maxresdefault.jpg


Transcript of the video:
Hey, welcome back to the MrExcel netcast.
I'm Bill Jelen.
Now, in yesterday's podcast we talked about a question that was sent separately by George and Alicia and I wanna revisit that question and they had a large data set with 20,000 rows, and they said we want to keep one record per customer.
That was George's question and Alicia said furthermore I want it to be the most recent record per customer and my simplifying assumption yesterday was, I was allowed to sort the data set but sometimes we're not gonna be allowed to sort the data set and so now, my solution is going to become a little bit more convoluted.
What I want to do, out here in column I, figure out the largest date for each customer.
So, I wanna build a formula that looks through all of the records and when it finds the largest value for this customer returns it.
So, here's how we're going to do that.
I'm going to say =MAX().
The MAX function of course will find the largest number within a series of numbers, but then I'm going to have an IF function. =IF(, this customer the customer in D2 is equal to the entire range of customers D2 to D564 and I'll make that b, F4 in other words if this customer matches the customer, then I want to see the date the corresponding date from C2 to C564, hit F4 there otherwise I want to see a 0.
So, what this is going to do for me, is it's going to give me in memory an array and for all the records let's say that match my current customer.
I'm going to have a date for all the other records I'm going to have a 0, and of course the max of all of those will be the largest record for that particular customer.
Now, in order to make this work it's a special formula, it's called an Array Formula.
We have to hold down the magic key stroke which is hold down control and shift while you hit enter.
Control and shift while you hit enter, and sure enough Excel will figure out that for, Bank of America the largest record is 12/28/2007 and as I copy this down, it should go through and figure out what the largest date is.
So, here for CitiGroup the last time that we sold to them was 12/15/2007, that Array Formula is doing all that magic and then Mckee Formula.
Now, is hey, let's see if this current date.
So, 7/17/2007 is equal to the max date most of the time we're gonna get False, but one record for every customer we will get True, and then just like yesterday will turn on the AutoFilter, and filter the most, the right most column to be true and we'll get just one record the most recent record for each customer plus the advantage is, we did not have to sort the data.
Much more difficult formula here to figure out the max.
Special kind of forming called an Array Formula, remember its control+shift+enter in order to make that work.
Hey, thanks for stopping by.
We'll see you next time for another netcast from MrExcel.
 

Forum statistics

Threads
1,214,965
Messages
6,122,496
Members
449,089
Latest member
Raviguru

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