Link to home
Start Free TrialLog in
Avatar of Mchallinor
MchallinorFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Excel bill of materials costing sheet insert items from lookup tables

Excel brains please help!

I'm trying to develop a "Costing Sheet" for totaling a bill of materials.
The sheet is easy for the user to build up a list of costs.  Each line has Drop Down Lists.
You can add new item rows on the sheet.


Eg.   If you were to design a t-shirt you would need a costing sheet like the following:

COSTING SHEET  (Bill of Materials)
Type of Garment ................................     {description}                       '   lookup Table 1
Fabric of Garment ..............................     {description}       {cost}     '   lookup Table 2
Embellishment on Garment ..............     {description}       {cost}     '   lookup Table 3
Job Template Cost ..............................     {description}       {cost}    '   calculation see {IF}
selection

Total __________________________________   $0.00
__________________________________________________

Lookup Table 1
Key ------  Code ------Description
1   --------  LS   -------Long Sleeve T Shirt        ' cost is determined on table 2 selection
2   --------  SS   -------Short Sleeve T Shirt       ' cost is determined on table 2 selection

Lookup Table 2
Key ------  Garment Code ------------ Description    ---------------- Cost
1 ------------  LS     ----------------------  Cotton           ---------------- $0.15
2 ------------- LS     ----------------------  Cotton Elastane -------------$0.20
3 ------------- SS     ----------------------  Cotton           ---------------- $0.11
4 ------------- SS     ----------------------  Cotton Elastane -------------$0.18

Lookup Table 3
Key ------- Description    -------------------- Cost
1 ----------  Embellishment A    -------------- $0.30
2 ----------  Embellishment B    -------------- $0.45
3 ----------  Embellishment C    -------------- $0.55
4 ----------  Embellishment D    -------------- {sub table}

Sub Table of Embellishment D
Key ------- Description    -------------------- Cost
1 ----------  1 Colour Print    --------------  $0.10
2 ----------  2 Colour Print     -------------- $0.20
3 ----------  3 Colour Print     -------------- $0.30
4 ----------  4 Colour Print     -------------- $0.40

Job Template Cost
IF LOOKUP TABLE 3 selection = 1 THEN  Job Cost = $0.50 ELSE
IF LOOKUP TABLE 3 selection = 2 THEN  Job Cost = $0.80 ELSE
IF LOOKUP TABLE 3 selection = 3 THEN  Job Cost = $0.90 ELSE
ELSE Job Cost = $0.00



It is like a database driven costing sheet  -  However it needs the flexibility to add new items.

This is example of a complete costing:
COSTING SHEET  (Bill of Materials)
Type of Garment ................................     [Long Sleeve T Shirt]
Fabric of Garment ..............................     [Cotton]                                                   $0.15
Embellishment on Garment ..............     [Embellishment D]   [2 Colour Print]       $0.20
Embellishment on Garment ..............     [Embellishment A]                                  $0.30
Embellishment on Garment ..............     [Embellishment B]                                  $0.45
Job Template Cost ..............................                                                                    $1.30

Total __________________________________   $2.40



I hope this explains what I'm looking for.   The most complicated part might be calcualting the 'Job Cost' line which I've used a IF formula, but it probably could be done better via a linked table or another method.

Open to all suggestions.

It could be done using a form with buttons?
It could be done using VB code?


I appreciate any advice.

Thanks
Mchalllinor
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Looks like you need the VLOOKUP function. The synatx for that is:

=VLOOKUP(LookupValue, LookUp Range, Offset, LookUp Type)

LookupValue - The value that you need to find in the left hand / first column of the data table
Lookup Range - The data table min which to find the value
Offset - The number of the column in the data range that containms the value that needs to be returned
LookUp type - True or False. False looks for an exact match for lookup value. True looks for the nearest match; for numbers it would be the nearest but not greater than, for text the nearest but not later in alphabet.

So, using your Embellishment D table as an example, with Table on tab called TableD:
Column A has index
Column B has description
Column C has value

For your example, you are trying to find "2 Colour Print" and return $0.20 so the formula would be, assuming "2 colour print" from dropdown in B3:

=VLOOKUP($B3,TableD!$B$1:$C$5,2,False)

If that doesn't help, a sample file would help.

Thanks
Rob H
ASKER CERTIFIED SOLUTION
Avatar of rfportilla
rfportilla
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mchallinor

ASKER

Thanks both rfportilla and robhenson

This morning I decided to jump into it -  Yes I'm using Data validation lists + vLOOKUP to return values.
There are some complexities that I just need to get my head around.

I should have a sample file in another hour.  I'll post it on here and you can tell me if you would have done it the same as me or if you have any suggestions.

Thanks..   Mchallinor
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Chris,

Yes,  That's how I've done it so far, although my example I'm currently working on is a little more complex, but thanks for that example.

I think it's the cross relationships between the tables that I find most complex.

Wait for my example
Hi,

OK, I've attached my progress so far.
I think it matches the suggestions so far, but I if you have any other tips , please let me know.

The difficulty I have at the moment, is although I can insert new lines the Colour Spin Button doesn't replicate.  I'm having a bit of trouble working out whats the best method of controlling the colour cost multiplier.

Thanks in advance for all the great help.

Mchallinor
Costing-Sheet--BOM--V1.xlsm
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
MacroShadow,

Yes, I do agree with you.  So some back ground information to ease your concerns...
I've got to model this best I can in excel to give the information to my software team, they will build this all on a SQL database.

So never fear this is just a conceptual document so that the software guys can see how I expect it to work (but much better) using SQL.

Thanks
Mchallinor
Maybe if it's conceptual, don't spend time on the VB, and just use validation lists to get it working.  You can make it look about the same as what you have in less time.  For dependent lists, use

 =INDIRECT(Cell)

for your list source, rather than a name.
Change the formula in G11 to
=IF(COUNTIF(D11,D11),IF(D11<>"Type D",H11,VLOOKUP(F11,Colour_Price_Books!$B$2:INDEX(Colour_Price_Books!$C$2:$C$1000,SUMPRODUCT(--(Colour_Price_Books!$C$2:$C$1000<>""))),2,FALSE)),"")

Open in new window

btw, what are you trying to accomplish with the Add Embellishment and Delete Row buttons?
Dear all,

Thanks for all the suggestions and help.   I've developed this beyond recognition from that original sample I uploaded.    

I've achieved my objective and the concept is with the developers now.

Thanks for the comments.

Mchallinor