Originally posted by: giantpinkbunnyhead
Originally posted by: Sid59
im working on this excel sheet and i need 2 fields to auto populate with data AFTER i've chosen an item in a drop down menu. (created via Validation)
example:
Item - Cost - Sale Price
Apple - $1.00 - $0.85
Orange - $0.88 - $0.45
etc
So i's have multiple items in a validated drop down menu. For every item in the menu, i need the 2 sequential cells to auto populate with values that correlate to that item.
I've tried going the path of a VSlookup but i couldnt grasp it enough to make this work with a drop down / validation list.
Any help would be great. Thanks.
PS. i know, i'd need a 2nd worksheet to keep track of all the items and values. So that's a a step in teh right direction.
Hi,
If I understand you right, you want to select a food item from a drop-down list you've created, and then have the cells to the right of it automatically show two prices associated with that particular item?
That's pretty simple. Firstly, a vlookup formula will work great here (and I'll help you through it). Second, the vlookup formula doesn't care if the thing it has to look up are from a drop-down list. All it cares is, what's typed in the box. Be it apple or orange or whatever. You also don't need your price data on a separate sheet. It can all live together.
To start, let's say you are using column A, starting at A1, to pick items from your drop down menu. Apple, orange, whatever... all that is going in Column A. Then we'll have columns B and C populate with the prices you attach to the food items. Let's say column D has your validation list, and we'll use column E,F, and G for listing out your food items and their two prices.
First thing is to make sure that your full list of items and associated prices is in alphabetical order, else the vlookup won't work right. After that, put the following formulas into B1 and C1: (Or whichever cells mark the top of the rows you want to populate)
For cell B1: =IF(A1>0,VLOOKUP(A1,
$E$1:$G$8,2),"")
For cell C1: =IF(A1>0,VLOOKUP(A1,
$E$1:$G$8,3),"")
In these formulas:
A1 = whichever cell has the drop down list that you pick from;
E1:G8 = dimensions of your price table (
note that you'll have to replace this with whatever the actual dimensions of your table are);
The number "2" after the G8 means, Excel is going to take whatever data is in the 2nd column of your table, that is next to whatever food item it's looking up. In the 2nd formula, the 2 is replaced with a 3, which will grab your second price.
These formulas are a bit more than vlookups; they will also cause the cell to remain blank if you haven't yet selected anything from the drop down menu. (Otherwise the cells will show #N/A). After that, Columns D through G don't really need to be visible so you can hide those columns. Everything will still work if they are hidden.
Once you have the formulas working, you can "drag", or copy, them as far down the columns as you need so that you can pick 50 or 500 items in column A and all their prices should populate.
If this isn't what you are looking for, then please provide more information so we can help if you still need it.