
Tips.Net > ExcelTips Home > Graphics > Displaying Images based on a Result
Summary: Got some images that you want to appear in a worksheet based on the result displayed in a cell? Figuring out how to “conditionally display” an image can be tricky, but it can be done following the steps in this tip. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, and Excel 2003.)
Dave has a large database that he keeps in an Excel workbook. It consists of material samples, and uses the VLOOKUP function to generate various forms and reports. Dave wants to include a bitmap image on the form that changes according to one of the variables. For instance, if the form is describing an apple, then Dave wants a picture of an apple to appear; if describing a pear, then a pear should appear, and so on.
This is certainly a challenging task, but it is one that can surprisingly be done without macros. The steps are involved, but not that difficult to perform once you get to it:
=IF(G1=1,"apple",IF(G1=2,"pear",IF(G1=3,"orange","")))
It is important that the formula reference the names exactly as you defined them in step 2 for each fruit's picture. For the sake of this example, I'll assume that you entered this formula in cell A1 of Sheet1.
=INDIRECT(Sheet1!$A$1)
Now, whenever the fruit name in cell A1 changes (which is, in turn, based on the value in cell G1), the image will change.
Tip #3128 applies to Microsoft Excel versions: 97 2000 2002 2003
Tame Your Data! ExcelTips: Filters and Filtering provides all the details necessary to let you manage large sets of data with confidence and ease. Its information-packed pages demonstrate how to use the two types of filters provided by Excel: AutoFilters and advanced filters.
Check out ExcelTips: Filters and Filtering today!
PivotTables don't need to be scary or mysterious. Use this powerful tool to analyze your data in ways you didn't know were possible. (more information...)
Ask an Excel Question
Make a Comment
ExcelTips FAQ
ExcelTips Premium
Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips
Advertise on the
ExcelTips Site