How to autopopulate multiple records (rows) from one drop down list

jaimem00

New Member
Joined
Jan 20, 2013
Messages
8
ISSUE:
I have looked and tried to use the vlookup, hlookup functions and I am unable to get anything started.
I would like to be able to choose a Size from a drop down list, that will autopopulate 1 of 2 lists of products and prices.
The parts are specific to the size.
After choosing the size, the Parts and Price table will populate below the chosen size.
I will manually insert the amount of items I needed for each part
This will calculate the total from the price*quantity, and then sum all the totals.

SIZES
PARTS2-10M2-15M4-10M4-15M5-10M5-15M7-10M7-15M
Gate FC (Manual)600600800xxxxx
Gate (Hyd.)6006000xxxxx
Seat Ring FC250250425xxxxx
Seat Ring Seal FC101010xxxxx
Body Bushing FC250250450xxxxx
Body Bushing Seal FC101010xxxxx
Retainer Plates FC9393250xxxxx
Operating Stem FC650650950xxxxx
Stem Packing FC555563xxxxx
Tail Rod255255285xxxxx
Bearing FC101020xxxxx
Race FC101020xxxxx
Bonnet Gasket FC100100115xxxxx
Gatexxx20002000200030003000
Seatxxx60060060012201220
Seat Seal (ID - OD)xxx5535355555
Operating Stemxxx14001400140021002100
Tail Rodxxx10001000100016001600
Stem Packingxxx220150220220220
Hydraulic Stemxxx20002000310031003100
Retainer Platexxx000785785
Bonnet Gasketxxx265150265501501

<tbody>
</tbody>


EXAMPLE
(SIZE) 7-15M
PartPriceQtyTotal
Gate3000
Seat1220
Seat Seal (ID - OD)55
Operating Stem2100
Tail Rod1600
Stem Packing220
Hydraulic Stem3100
Retainer Plate785
Bonnet Gasket501
TOTAL:

<tbody>
</tbody>
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi jaimem00

This should be possible but with some assumptions & caveats. This should get you started though...

I presume you have your core data (i.e. the list of prices per part & size) on one sheet, starting at A1. Let's call that sheet 'Data'. Select the range of cells containing that table of information and name it 'Prices'. Also, select the range of cells containing the different sizes (i.e. row 2 based on what you have pasted below) and name it 'Sizes'

Next, I presume you have your 'form' which you want to populate with the data on a separate sheet. Let's call that sheet 'Form'. Select the cell where you want your dropdown (to select the size) and do the following :

Data > Data Validation... > Settings > Validation criteria
Allow: List​
Source: "=Sizes"
This should give you your dropdown (I've used cell B1)

Next, under your price column, use the following formula

=VLOOKUP($A4,Prices,MATCH($B$1,Sizes,0)+1,FALSE)

In other words, look up the part in column A in the 'Prices' named range, and return the value in the column matching the size provided by the dropdown (the extra +1 accounts for the fact that the sizes start in column B, not column A...) Note that I've anchored the reference cell for the size ($B$1) so it won't shift as you drag the formula down / across.

Bear in mind that for this to work properly, you should really have unique names for all your parts (as the VLOOKUP will return the first instance it finds) - so there will be a conflict with the likes of "Tail Rod" which you have in twice.

But should be enough to get you started?

AOB
 
Upvote 0
Thanks again.
However, I am getting an error under 'Price' column, where I put the vlookup fxn.
I have my drop down on sheet 'Form' in cell 'A5'.

To make sure I have created the 'Ranges' correctly; I dont have the words Parts or Sizes like above.
B1:I1 are my different Sizes
A2:A23 are my diffrent Parts (all uniquely named, just added an 's' to the first 'Tail Rod').

Range 'Prices' = A1:I23
Range 'Sizes' = B1:I23
 
Upvote 0
Your 'Sizes' range should only cover the size categories, not any of the corresponding values underneath

So Range 'Sizes' should be = B1:I1 (not B1:I23)
 
Upvote 0
You can/should add a handler for scenarios where the part is not recognised or if no size has been specified by the dropdown (show as blank rather than #N/A)

=IF(ISERROR(VLOOKUP($A4,Prices,MATCH($B$1,Sizes,0)+1,FALSE)),"",VLOOKUP($A4,Prices,MATCH($B$1,Sizes,0)+1,FALSE))

Other than that, it should work (make sure you have selected a size from the dropdown!)
 
Upvote 0
I corrected the range for 'Sizes'.

But, I am still getting an error for the price. Should I be?
here is how my table is created, then the drop down starts again at F5
A
A5 (SIZE) 7-15M
BCD
A6
A7 PartPriceQtyTotal
A8 Gate3000
A9 Seat1220
A10 Seat Seal (ID - OD)55
A11 Operating Stem2100
etc xxx
etc xxx
etc xxx
A20 xxx
A21 Total

<tbody>
</tbody>
 
Upvote 0
Bear in mind, my formula assumes the dropdown is in cell B1 and the part name is in column A :

=IF(ISERROR(VLOOKUP($A8,Prices,MATCH($B$1,Sizes,0)+1,FALSE)),"",VLOOKUP($A8,Prices,MATCH($B$1,Sizes,0)+1,FALSE))

You may need to modify it to suit if you have multiple dropdowns for different sections, or if you have your table laid out differently?
 
Upvote 0
Yes sir, I changed A4 to A8 originally.
However, when I drop down and select a size. I don't have anything returned.
I have my form and data sheet just as stated above.
 
Upvote 0
For all of the parts or just some specific ones? (If specific, are they definitely referenced on your lookup table, and within the range defined by 'Prices'?)

And do you have calculations turned on? (Formulas > Calculation > Calculation Options > Automatic)

It works fine for me...

Data sheet :

"Sizes" = B1:I1
"Prices" = A1:I23


A

B

C

D

E

F

G

H

I
1
2-10M
2-15M
4-10M
4-15M
5-10M
5-15M
7-10M
7-15M
2
Gate FC (Manual)
600
600
800
x
x
x
x
x
3
Gate (Hyd.)
600
600
x
x
x
x
x
4
Seat Ring FC
250
250
425
x
x
x
x
x

<TBODY>
</TBODY>


Form sheet :


A

B

C

D
1
2
3
4
5
(SIZE)
7-15M dropdown
6
7
Part
Price
Qty
Total
8
Gate
3000
9
Seat
1220
10
Seat Seal (ID - OD)
55
11
Operating Stem
2100

<TBODY>
</TBODY>


Formula in B8 :

=IF(ISERROR(VLOOKUP($A8,Prices,MATCH($B$5,Sizes,0)+1,FALSE)),"",VLOOKUP($A8,Prices,MATCH($B$5,Sizes,0)+1,FALSE))
 
Upvote 0

Forum statistics

Threads
1,215,178
Messages
6,123,484
Members
449,100
Latest member
sktz

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