Learn Excel 2010 - "Picture Lookup": Podcast #1485

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 Dec 7, 2011.
Prince asks if there is a way to return a Picture as the result of a VLOOKUP instead of a Value. In Episode #1485, Bill shows us one way to solve the challenge and deliver the result.
maxresdefault.jpg


Transcript of the video:
MrExcel podcast is sponsored by Easy-XL.
Learn Excel from MrExcel, Episode 1485 – Picture Lookup Today's question is sent in by Prince.
Prince wants to do a lookup using either VBA, but it doesn't want to return a value, it wants to return a picture.
And hey, by the way, I am just getting back from Florida this morning.
Good morning that you're watching this.
Shoot me a note – Bill@MrExcel.com.
If you have questions for the podcast, I'll be looking to do another week's worth of podcast, so shoot those questions in.
All right.
So here's what we're going to do.
We are going to put the pictures right here, in these cells.
I want to make these cells taller, format row height.
Let's go with about 100.
How does that look?
Yes.
And just make them wider, all right.
Column A – you don't have to do this.
It just bugs me.
Vertical-align top.
All right.
So now, insert the pictures here.
Make sure that they fit completely inside that cell.
I'm not going to do pictures, I'm just going to do Shapes.
So there's picture number 1, and here, insert Shapes.
Picture number two, hold down the Shift key to get a nice perfect circle.
And picture number three, insert Shapes – a triangle.
And picture number four, insert Shapes.
Let's go with smiley face.
Perfect.
Okay, so we have our four pictures.
Now we want to be able to choose from this list.
So I'm going to name the list, select the list, and we'll call it ProdList.
This is on a sheet called Sheet 2.
Let's go back to Sheet 1.
This is where we're going to enter our product.
So here, we want to have a dropdown.
I do Alt+D+L for data validation.
We're going to allow a List, and the source is =ProdList.
Click OK.
All right.
So there we can choose from the list.
And over here, a secret hidden formula, =MATCH(C3,ProdList,0) equal MATCH.
Go look for that item in the ProdList comma 0 or False.
It tells me which item I chose – the second item, the third item, or the fourth item or so on.
I'm going to need that to get the picture to work.
All right.
Let's do the picture.
We're going to copy this cell first, Ctrl C to copy.
Go back to where we want the picture to display and paste, paste the picture link.
All right.
That's cool.
That's a linked picture.
And check this out, this is the formula says, hey, go to Sheet 2, exclamation point, B2.
=Sheet2!$B$2.
Well, we want to replace that with something a little bit more fancy, but we're not allowed to put a formula here, but we can put named range in there.
So check this out.
We're going to go to Formulas, Define Name.
I'm going to call it, MyPic.
MyPic is equal to Sheet2!$B$1.
All right.
So we're going to point to that heading, but I want to move down from there, so we’re going to use the offset function.
OFFSET(Sheet2!$B$1).
And the offset says, hey, from that B1 cell, we want to move down some number of cells.
How many cells do we want to move down?
Oh, well.
That's found on Sheet 1, OFFSET(Sheet2!$B$1),Sheet1!$E$3,0).
And then, how many columns over?
No columns over so, OFFSET(Sheet2!$B$1),Sheet1!$E$3,0).
That is now a defined name.
MyPic will go to Sheet 2 starting cell B1, and go down the number of cells that we've indicated here.
Click OK, all right.
Now, check this out.
I click back on the linked picture.
It has a formula.
I'm going to erase that formula but I’m going to say, =MyPic, Enter.
Oh, look at that.
It already worked.
So we choose from the list, A101, we get the first picture, and so on.
Pretty wild trick.
Tough to set up that offset function.
I actually practiced once before the podcast.
You need to make sure to get all the dollar signs in there and the whole thing.
Matter of fact, let's look at that one again because that definitely is the most difficult part.
So = OFFSET(Sheet2!$B$1),Sheet1!$E$3,0) – equal offset.
Make sure to specify the sheet - dollar sign B dollar sign 1 and then, number of rows down.
We're going back to Sheet 1.
Even though this formula kind of lives on Sheet 1, it's not actually 1, it's on that picture.
So we want to make sure that we're explicitly saying, hey, go to Sheet 1, cell E3.
Cool, cool way to go.
All right.
Hey, I want to thank everyone for stopping by.
Remember to send in your questions to Bill@MrExcel.com.
Watch out for the podcast this upcoming week.
And I’ll see you next time for another netcast from MrExcel.
 

Forum statistics

Threads
1,214,826
Messages
6,121,794
Members
449,048
Latest member
greyangel23

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