+ Reply to Thread
Results 1 to 17 of 17

calculate receipe bom cost

Hybrid View

  1. #1
    Registered User
    Join Date
    05-28-2013
    Location
    sri lanka
    MS-Off Ver
    Excel 2019
    Posts
    38

    calculate receipe bom cost

    i want to calculate the receipe bom cost with excel function with the help of data in the column D & F named as S.NO & RECEIPE NAME.

    ColumnD named as SNO represents the receipe category which is further divided into sub-category of main receipe category, while column F named as RECEIPE NAME is item description.
    ColumnE contains seperate items which comes together to form RECEIPE.

    for detail please see the attach file.


    Regards,
    Deepak
    Attached Files Attached Files
    Last edited by db; 09-15-2022 at 03:15 AM.

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,999

    Re: calculate receipe bom cost

    Hi Depak -Please explain your concept how you wish to achieve your desired result and what are criteria and final result value.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,908

    Re: calculate receipe bom cost

    Are you still using Excel 2007 ? If not, please update your profile with current version.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Registered User
    Join Date
    05-28-2013
    Location
    sri lanka
    MS-Off Ver
    Excel 2019
    Posts
    38

    Re: calculate receipe bom cost

    no i am using excel 2010 and updated my profile from excel 2007 to 2010

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: calculate receipe bom cost

    You did not counted the expected result manualy in your file, so I could not check the result.


    With a Pivot Table.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,908

    Re: calculate receipe bom cost

    Results are explained:

    G4 = sum(G5:G7)

    i.e A (G4) =sum(B:D) where A, B ... etc refer to letters in column E

  7. #7
    Registered User
    Join Date
    05-28-2013
    Location
    sri lanka
    MS-Off Ver
    Excel 2019
    Posts
    38

    Re: calculate receipe bom cost

    G4 = sum(g5:g7) is manually dragged formula, i want some if condition type formula which auto calculated consider key data in the column D & F.

  8. #8
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2503 Build 16.0.18604.20000) 64-bit
    Posts
    3,999

    Re: calculate receipe bom cost

    So that is what i am asking how your conditions are building ? How G4= Sum(G5:G7)??

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,908

    Re: calculate receipe bom cost

    The summation is based on "S.No"

    Level 1 (or first level) is sum of single number levels 1,2,3: Level 3 is the sum of 3.1 and 3.2 and so on.
    Last edited by JohnTopley; 09-15-2022 at 04:18 AM.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,908

    Re: calculate receipe bom cost

    @depak: See post #3 and please reply to it.

  11. #11
    Registered User
    Join Date
    05-28-2013
    Location
    sri lanka
    MS-Off Ver
    Excel 2019
    Posts
    38

    Re: calculate receipe bom cost

    Quote Originally Posted by JohnTopley View Post
    The summation is based on "S.No"

    Level 1 (or first level) is sum of single number levels 1,2,3: Level 3 is the sum of 3.1 and 3.2 and so on.

    may be your are understanding the matter..

  12. #12
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: calculate receipe bom cost

    @depak.bish

    Please also reply on #4.

  13. #13
    Registered User
    Join Date
    05-28-2013
    Location
    sri lanka
    MS-Off Ver
    Excel 2019
    Posts
    38

    Re: calculate receipe bom cost

    Quote Originally Posted by oeldere View Post
    @depak.bish

    Please also reply on #4.

    unfortunately didn't get the desired result. with pivot it sumup the cost twice, because sub-category is already sumup where i put the manual formula

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,908

    Re: calculate receipe bom cost

    Sub BOM_Sum()
    Dim rng As Range
    Dim ar
    
    Application.ScreenUpdating = False
    
    lr = Cells(Rows.Count, "D").End(xlUp).Row
    Set rng = Range("D1:H" & lr)
    srow = 4
    
    For r = 1 To lr  ' Loop through data
    
        rname = rng(srow, 3)   ' Recipe Name
    
        n = Application.WorksheetFunction.CountIf(rng, rname)  ' Count rows for is Recipe
        
        nrow = n
        lrow = srow + n - 1
        
        ar = Range("D" & srow & ":G" & lrow)  ' assign data to work array
           
        ar(1, 4) = 0   ' Set total to zero
        
        Do While nrow >= 2  ' Loop through array ( last to first)
        
            sNo = Len(ar(nrow, 1))  ' length of S.No
            
            Select Case sNo
            
                Case Is = 1  ' single S.No (1,2 3 etc)
                    first = True
                    For i = 2 To n
                        If InStr(1, ar(i, 1), ar(nrow, 1)) > 0 And i <> nrow And Left(ar(i, 1), 1) = ar(nrow, 1) Then
                           If first Then
                               ar(nrow, 4) = ar(i, 4)
                               first = False
                           Else
                               ar(nrow, 4) = ar(nrow, 4) + ar(i, 4)
                           End If
                       End If
                    Next i
                    
                    ar(1, 4) = ar(1, 4) + ar(nrow, 4)
                    
                Case Is = 3 'sno of form "x.y"
                
                    first = True
                    For i = 2 To n
                        If InStr(1, ar(i, 1), ar(nrow, 1)) > 0 And i <> nrow Then ' match to "x.y.z"
                           If first Then
                               ar(nrow, 4) = ar(i, 4)
                               first = False
                           Else
                               ar(nrow, 4) = ar(nrow, 4) + ar(i, 4)
                           End If
                         End If
                     Next i
                
            End Select
            
            nrow = nrow - 1
        Loop
        
        Range("K" & srow).Resize(UBound(ar, 1), UBound(ar, 2)) = ar  'output results
        
        srow = lrow + 2
        r = srow - 1
        
    Next r
    
    Application.ScreenUpdating = True
    
    End Sub
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    05-28-2013
    Location
    sri lanka
    MS-Off Ver
    Excel 2019
    Posts
    38

    Re: calculate receipe bom cost

    Quote Originally Posted by JohnTopley View Post
    Sub BOM_Sum()
    Dim rng As Range
    Dim ar
    
    Application.ScreenUpdating = False
    
    lr = Cells(Rows.Count, "D").End(xlUp).Row
    Set rng = Range("D1:H" & lr)
    srow = 4
    
    For r = 1 To lr  ' Loop through data
    
        rname = rng(srow, 3)   ' Recipe Name
    
        n = Application.WorksheetFunction.CountIf(rng, rname)  ' Count rows for is Recipe
        
        nrow = n
        lrow = srow + n - 1
        
        ar = Range("D" & srow & ":G" & lrow)  ' assign data to work array
           
        ar(1, 4) = 0   ' Set total to zero
        
        Do While nrow >= 2  ' Loop through array ( last to first)
        
            sNo = Len(ar(nrow, 1))  ' length of S.No
            
            Select Case sNo
            
                Case Is = 1  ' single S.No (1,2 3 etc)
                    first = True
                    For i = 2 To n
                        If InStr(1, ar(i, 1), ar(nrow, 1)) > 0 And i <> nrow And Left(ar(i, 1), 1) = ar(nrow, 1) Then
                           If first Then
                               ar(nrow, 4) = ar(i, 4)
                               first = False
                           Else
                               ar(nrow, 4) = ar(nrow, 4) + ar(i, 4)
                           End If
                       End If
                    Next i
                    
                    ar(1, 4) = ar(1, 4) + ar(nrow, 4)
                    
                Case Is = 3 'sno of form "x.y"
                
                    first = True
                    For i = 2 To n
                        If InStr(1, ar(i, 1), ar(nrow, 1)) > 0 And i <> nrow Then ' match to "x.y.z"
                           If first Then
                               ar(nrow, 4) = ar(i, 4)
                               first = False
                           Else
                               ar(nrow, 4) = ar(nrow, 4) + ar(i, 4)
                           End If
                         End If
                     Next i
                
            End Select
            
            nrow = nrow - 1
        Loop
        
        Range("K" & srow).Resize(UBound(ar, 1), UBound(ar, 2)) = ar  'output results
        
        srow = lrow + 2
        r = srow - 1
        
    Next r
    
    Application.ScreenUpdating = True
    
    End Sub
    thanks john,
    the vba code are perfectly working, but appreciate if someone provide the desired result with functions formula using nesting or any other...



    Regards,
    dsb

  16. #16
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,908

    Re: calculate receipe bom cost

    in Sheet2 ....

    Helper columns in I & j

    in I4

    =--SUBSTITUTE(D4,".","")

    in J4

    =INT($I4/100)

    in K4

    Formula: copy to clipboard
    =IF(COUNTIF($F$4:$F4,$F4)=1,IF(J4=0,SUMIFS($G5:$G$26,$J5:$J$26,0,$F5:$F$26,F5)),IFERROR(IF(MATCH(I5,J4:$J$26,0),SUMIFS(G5:$G$26,J5:$J$26,I5,F4:$F$26,F5)),G4))
    Attached Files Attached Files
    Last edited by JohnTopley; 09-16-2022 at 08:23 AM.

  17. #17
    Registered User
    Join Date
    05-28-2013
    Location
    sri lanka
    MS-Off Ver
    Excel 2019
    Posts
    38

    Re: calculate receipe bom cost

    waiting for the solution from forum excel expert

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 08-27-2021, 10:28 AM
  2. How to calculate added cost
    By metal.stuff in forum Excel General
    Replies: 3
    Last Post: 06-27-2016, 04:38 PM
  3. [SOLVED] Calculate cost per month inlcuding cost of former months
    By keis386 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-15-2015, 11:17 AM
  4. Calculate the correct cost when more than 1 cost price
    By CplSmudge in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-25-2012, 01:12 PM
  5. Calculate cost with three variables
    By Keltic in forum Excel General
    Replies: 3
    Last Post: 04-22-2012, 11:17 AM
  6. Calculate avg cost p/m?
    By zudecke in forum Excel General
    Replies: 4
    Last Post: 11-26-2010, 09:09 AM
  7. Cost Driver calculation - Looking for formula/macro to calculate manpower cost alloca
    By Swastik Banerje in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-30-2009, 11:18 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1