Consulting

Results 1 to 7 of 7

Thread: Calculate BOM levels with target price

  1. #1

    Calculate BOM levels with target price

    Hello
    i'm trying to create a macro (preferred) or a formula that will calculate my BOM levels automatically.
    I have a BOM with 5 levels (can be more) with prices for each item and total price that is accumulated price refer to the BOM levels.
    When i addend a new columns named "Target price" i wanted to define my price and update the BOM levels that are below and above with the new price.
    columns H, I and J are examples for the calculation should be used and column K is the "new Bom Price" (the percentage on the item by its level multiplied with the accumulated price) according to the percentages in the BOM.

    Thanks

    Avi
    Attached Files Attached Files

  2. #2
    CAN SOMEONE HELP ME ?

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    This seems to work with your example sheet:
    Sub blah()
    For Each cll In Range("A2:A20")
      Set celle = cll.Offset(1)
      x = cll.Offset(, 2).Value
      Level = CLng(Replace(cll.Value, ".", ""))
      Do Until CLng("0" & Replace(celle.Value, ".", "")) <= Level
        x = x + celle.Offset(, 2).Value
        Set celle = celle.Offset(1)
      Loop
      cll.Offset(, 3) = x
    Next cll
    End Sub
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  4. #4
    Thanks for the answer, but the answer doesn't reffer to the target price - the target price (in column G) should be a number that the user will enter and all the levels below that will get a new price according to their percentege in the BOM (there is an example in the attachment).
    its urgent
    thanks


    Avi

  5. #5
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,647
    What is BOM ??

    I don't like shouting posters.

  6. #6
    BOM = Bill Of Materialthis is an hierarchy list of all the items in which a product tree in build from.
    each "father" has many or one child (2 levels) and the childs have more levels below them
    the excel which i attached shows the process need to be done and the calculations


    Avi

  7. #7
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    I think this is very easy.
    Take your target price of 280 and your actual price of 229.19 in cells G8 and F8 respectively and use them in the forumula:
    =G8/F8
    Let's put that in cell (say) O7.
    Then in cell L8 have the following formula:
    =C8*$O$7
    paying attention to the $ symbols.
    Format the cell as you wish (your others were numeric to 1 decimal place) and copy down to L20.
    The values in the cells L8:L20 exactly match your example range K8:K20 but calculated a lot more simply.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •