MrExcel's Learn Excel #820 - PULL

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 Jan 12, 2009.
Building on yesterday's podcast, life becomes considerably more complex if you need to use VLOOKUP to look into a different workbook based on a date. Episode 820 will show you why INDIRECT won't work and takes a look at how to use Harlan Grove's PULL function. Download the function from ftp://members.aol.com/hrlngrv/pull.zip

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


Transcript of the video:
Hey. Welcome back to the MrExcel netcast. I'm Bill Jelen.
Well, let's actually get to Keith's question.
Now, in yesterday's netcast, I showed how we could use INDIRECT to grab values from various worksheets in the current workbook, but Keith has the completely different problem.
Every day, his sales are saved to a new workbook.
So, he has workbooks, for example, called SALES20080807 and there will be a different workbook for every day, and he needs a VLOOKUP that's going to go grab the right workbook, and find the value and return the value.
Well, that's just not going to work.
We have INDIRECT.
Well, there's a couple of problems.
INDIRECT cannot look into a closed workbook.
So, what Keith would have to do, here on my second sheet, is actually keep all of those workbooks open, which probably is not realistic, and so what we're going to do is we're going to use a great function that was written by Harlan Grove.
Now, now you can just go out to Google and search for HARLAN GROVE PULL and you'll get to the code.
It's posted in several different places.
I took that code and I pasted it into Excel as a new user function called PULL, and the way that PULL works is, basically, I set up a concatenation here that builds the file name.
So, we have our DATE over in column A; in column C, I used the TEXT function, like we did yesterday, to convert that to the correct format; build the FILE NAME here; the worksheet name, SHEET1 all the time; and then the RANGE where we want to look up; and then, finally, the PULL function.
Basically, the PULL function becomes the second argument in VLOOKUP.
So, we PULL the ‘, the file name, the worksheet name, the ’, the bang character, the ! mark, and the range name.
That function will go out and open the file, and return the whole array to Excel.
Now, it's a bit slow.
It would work here if I'm just pulling one or two values from each worksheet for 30 days, but if you were looking up hundreds or thousands of these, the recap time would be impossible, but, if you have a few, great way to do this using Harlan Grove’s PULL function.
Well, I want to thank you for stopping by.
We'll see you next time for another netcast from MrExcel.
 

Forum statistics

Threads
1,224,872
Messages
6,181,498
Members
453,047
Latest member
charlie_odd

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