Costings using VLOOKUP based on multiple dropdown options

GemmaTH

New Member
Joined
Feb 18, 2019
Messages
4
Hi all,

New to the forum and my Excel skills need a bit of work! Hoping someone might be able to help please?

I am currently creating a costing spreadsheet - each tab/worksheet relates to a specific supplier and contains the items they sell and their prices. I'd like to create a front sheet using drop down lists & formulas that will pull costing information through into a quote.

For example, cell D9 contains a dropdown list created using data validation and a source list named "Supplier". Cell E9 then populates with a further drop down showing the list of items available from this supplier, using data validation "source =indirect(D9)". Cell F9 contains the quantity needed and, in cell G9, I want to calculate the cost of the purchase.

DEFG
SupplierItemQuantityCost
9ABCTimber2£

<tbody>
</tbody>


I have tried using VLOOKUP to do this but can't work out how to get the table array to change depending on what's been chosen in Column D?

For example, for supplier ABC, I have used VLOOKUP(E9,ABC!$C$10:$D$52,2)*F9. This works well and will calculate exactly what I need (the items being in column C and costs being in column D of the ABC tab). However, this formula still points to supplier ABC's price list, even if I select supplier DEF from the drop down in column D.

Is there a way for the VLOOKUP formula to change in accordance with which supplier has been selected in D9? Or should I be using a different formula / method entirely?

I hope this makes sense - as I said, I'm still learning when it comes to anything more than a very basic spreadsheet! It would be great if somebody can help shed some light.

Thanks,
Gemma
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi Alan,

Thanks so much for your quick reply. I think I'm ok with creating the drop down lists themselves, what I'm having trouble with is the formula to work out costs based on what has been selected.

Sorry, I may not have been very clear with my question in my original post! Essentially,what I need to know is how to get the VLookup (or perhaps sum?) formula to automatically adjust depending on what has been selected in the drop downs.

e.g. If I select Supplier "ABC" and item "timber" I need the formula in column G to find the unit price of the timber and then multiply it by the specified quantity in column F to calculate the cost. Similarly, if in the row below, I choose Supplier "DEF", the formula will then need to know to point to DEF's underlying worksheet/tab within the spreadsheet to find the correct price.

Is this something that you might be able to help with?

Thanks again!
G
 
Upvote 0
it will be easier if you can arrange your item/cost in a table like this


Book1
ABCDEFGH
1SupplierItemCostSupplierItemQuantityCost
2ABC1Item110ABC2Item82160
3ABC1Item220
4ABC1Item330
5ABC1Item440
6ABC1Item550
7ABC2Item660
8ABC2Item770
9ABC2Item880
10ABC2Item990
11ABC2Item10100
12ABC3Item11110
13ABC3Item12120
14ABC3Item13130
15ABC3Item14140
16ABC3Item15150
17ABC4Item16160
18ABC4Item17170
19ABC4Item18180
20ABC4Item19190
21ABC4Item20200
Sheet7
Cell Formulas
RangeFormula
H2=G2*SUMIFS($C$2:$C$21,$A$2:$A$21,E2,$B$2:$B$21,F2)
 
Upvote 0
Yes, that does look much easier (thank you!), but I've been asked to keep a supplier per tab for formatting by my colleagues who will eventually use this. I'm looking at more than 30 suppliers, and a whole range of stock items for each, so the idea is that we keep a price list for each supplier and a "master" sheet that will pull the required information through into a quote.

Really appreciate your help - I'm not even sure if what I am trying to do is possible! :eek:
 
Upvote 0
may be you can try this

suppliers sheets


Book1
ABCD
1Item1110
2Item2120
3Item3130
4Item4140
5Item5150
6Item6160
7Item7170
8Item8180
9Item9190
10Item10200
Supplier1



Book1
ABCD
1Item1210
2Item2220
3Item3230
4Item4240
5Item5250
6Item6260
7Item7270
8Item8280
9Item9290
10Item10300
Supplier2



Book1
ABCD
1Item1310
2Item2320
3Item3330
4Item4340
5Item5350
6Item6360
7Item7370
8Item8380
9Item9390
10Item10400
Supplier3


and the master front sheet


Book1
ABCD
1SupplierItemQuantityCost
2Supplier1Item61160
3Supplier2Item71270
4Supplier3Item81380
5Supplier2Item91290
6Supplier1Item101200
Master
Cell Formulas
RangeFormula
D2=C2*SUMIF(INDIRECT(A2&"!c:c"),B2,INDIRECT(A2&"!d:d"))
 
Upvote 0
btw, to answer your original question you can use vlookup instead

=C2*VLOOKUP(B2,INDIRECT(A2&"!C:D"),2,0)
 
Upvote 0

Forum statistics

Threads
1,214,391
Messages
6,119,244
Members
448,879
Latest member
VanGirl

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