+ Reply to Thread
Results 1 to 64 of 64

Summary of daily data based on different criteria

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Question Summary of daily data based on different criteria

    This was posted on VBA forum but, not received any solution.

    Dear experts,
    I have attached here an excel work sheet.
    Let me describe how this works;
    >> this work sheet contains "sheet tabs" for each day and items/styles running in the production line.
    >> Production lines are named as A1, B1 etc, and one item/style runs in a particular day.
    >> The production time/duration of an item/style varies (it can be 1,2,3,5, 10,15, or any number of days depending on the order qty and daily targets/achievement.
    >> A production line can have more than one/two/three or more items/styles in a month. But, each item/style has different names.
    >> A month can start from any day and end in the same way, and this work sheet includes only the days factory worked.
    >> The sheet tabs has some formulas in some columns/cells
    >> End of the month, we prepare an item/style wise summary adding the daily information recorded on the sheet tabs.
    >> This kind of work sheets are used for different factory locations (currently, I have 6 factory locations whose daily data are recorded on this kind of a work sheet)

    Summary making process is time consuming and gives rise to a lot of MANUAL CALCULATION ERRORS.
    I need your support to summarize daily data in to a sheet called "Style Wise Summary" using a VBA macro program.

    The Style Wise Summary has different column labels which are self explained

    ** Columns that are in "BLUE", has the item/style basic details and these information repeat every day till the end of the style/item
    ** Column "I & K" should calculate the cumulative, but should be shown as an "average" as per the number of "days" style/item runs
    ** All "RED" columns should calculate the "cumulative/totals" of the given criteria.
    ** In the Summary report, all items produced in a particular line (A1, B1 etc) should be shown in the rows one below the other as per the order of progression.

    Pls ask me if you need any more information.

    Thanks in advance.
    Last edited by Anuru; 05-17-2018 at 12:08 PM.

  2. #2
    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,781

    Re: Summary of daily data based on different criteria

    People may have deemed this to large a project (to do unpaid) so maybe contact "Commercial Services"
    Last edited by JohnTopley; 05-17-2018 at 04:23 AM.

  3. #3
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Quote Originally Posted by JohnTopley View Post
    People may have deemed this to large a project (to do unpaid) so maybe contact "Commercial Services"
    Hi John,
    Okay, I will try to contact commercial services.

  4. #4
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Hi John,
    I purchased points, but don't know how to post this on to commercial services. Can you help me to pls how to do that..

  5. #5
    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,781

    Re: Summary of daily data based on different criteria

    Further points:

    Please remove commercially-sensitive information from your file e.g customer names.

    And post a file with say 3 sheets AND show some expected results ( 6 or 10 rows will do).

    I don't know to contact Commercial Services but will try and finfd out how this is done.
    Last edited by JohnTopley; 05-17-2018 at 06:31 AM.

  6. #6
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Summary of daily data based on different criteria

    Good morning Anuru

    You purchase points from here : http://www.excelforum.com/payments.php

    You post your question here : https://www.excelforum.com/commercial-services/

    I believe that you cannot access the commercial board until you have bought some points. You should be able to get to the commercial sub-forum from either the link above, or looking for the "Commercial Services" section about half way down the Excel Forum home page.

    Please post back if you cannot get on.

    HTH

    DominicB
    Last edited by dominicb; 05-17-2018 at 07:10 AM.

  7. #7
    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,781

    Re: Summary of daily data based on different criteria

    Anuru,
    I have a solution but need you to define the various average calculations.

    Plus I suggest putting the month on the "Style Wise summary" sheet so it can be used to select the month(ly) data sheets.

    AND please remove the merged cells at the bottom of each data sheet as I need column A to be blank (other than line IDs) so I can determine the number of entries in each tab. This is "bad" practice and should be avoided.

    John
    Last edited by JohnTopley; 05-17-2018 at 10:59 AM.

  8. #8
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    I ma working on the work sheet now..pls wait...

  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,781

    Re: Summary of daily data based on different criteria

    I just need the AVERAGE calculation: everything else looks OK.

  10. #10
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Plus I suggest putting the month on the "Style Wise summary" sheet so it can be used to select the month(ly) data sheets.

    I added a month column before line nos, and I would like to have the last date of the month on that.

    AND please remove the merged cells at the bottom of each data sheet as I need column A to be blank (other than line IDs) so I can determine the number of entries in each tab. This is "bad" practice and should be avoided.

    un merged all, and I have put comments on the cells for all the calculation types..also removed sensitive data..
    Last edited by Anuru; 05-18-2018 at 05:52 AM.

  11. #11
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Also, it doesn't matter if "line nos" show in front of every item/style..

    I have attached with the change...

  12. #12
    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,781

    Re: Summary of daily data based on different criteria

    Sub style_Summary()
    
    'Optimize Macro Speed
      Application.ScreenUpdating = False
      Application.EnableEvents = False
      Application.Calculation = xlCalculationManual
    
    Call Get_Data ' put all data in one sheet (named "Data")
    
    Call create_summary
    
    'Reset Macro Optimization Settings
    
        Application.EnableEvents = True
        Application.Calculation = xlCalculationAutomatic
        Application.ScreenUpdating = True
    End Sub
    Sub create_summary()
    
    Dim ws1 As Worksheet
    Dim ws2 As Worksheet
    
    Dim InRng As Range
    Dim Inarr() As Variant
    Dim Outarr() As Variant
    '
    ' idx is array of column numbers to be selected for output (first element of 0 ignored)
    '
    idx = Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 18, 20, 21, 22, 23, 24, 25)
    
    Set ws1 = Worksheets("Data")
    Set ws2 = Worksheets("Style Wise Summary")
    
    With ws1
    
        lr = .Cells(Rows.Count, "A").End(xlUp).Row
        
        Inarr = .Range("A2:Y" & lr)  ' Assign data to in-memory array
        ReDim Outarr(1 To 22, 1 To 1) ' Dimesion to output arrat
        
        Style = Inarr(1, 3)  ' First Style
        lineID = Inarr(1, 1) ' First Line ID
        ns = 1               ' count of styles
        r = 1                ' Start index for input array
        rr = 0               ' Index for output array
        
        Do Until r > UBound(Inarr, 1)  ' Loop through input data
        
            If Inarr(r, 3) = Style And Inarr(r, 1) = lineID Then ' If this is first occurence of a style within a Line Id ....
                If ns = 1 Then     ' First record for this Line ID/Style
                    rr = rr + 1
                    ReDim Preserve Outarr(1 To 22, 1 To rr)  ' Redimension output array
                    For k = 1 To UBound(idx, 1)              ' Loop through column indices to create output array
                        c = idx(k)
                        Outarr(k, rr) = Inarr(r, c)  ' Store first occuence of each variable
                    Next k
                    ns = ns + 1
                    r = r + 1
                Else
                    For k = 11 To UBound(idx, 1)    ' Second and subsequent records for this Line ID/Style
                        j = idx(k)
                        Outarr(k, rr) = Outarr(k, rr) + Inarr(r, j)  ' Accumulate totals
                    Next k
                    ns = ns + 1
                    r = r + 1
                End If
             Else
                '
                ' Calculate averages for this Line ID/ Style
                '
                Outarr(10, rr) = Outarr(10, rr) / ns  ' Day Target
                Outarr(12, rr) = Outarr(12, rr) / ns  ' DHU
                Outarr(20, rr) = Outarr(20, rr) / ns  ' Efficiency
                
                If Inarr(r, 1) <> lineID Then rr = rr + 1 ' Add "spacer" line if new Line ID
                
                Style = Inarr(r, 3)    ' Set next style
                lineID = Inarr(r, 1)   ' Set next Line ID
                ns = 1
            End If
        
       Loop
        
    End With
    
    With ws2  ' sheet "Style wise Summary"
    
     .Range("A4:V1000").ClearContents  ' Clear the outpur range
    
     .Cells(4, "A").Resize(rr, 22) = Application.Transpose(Outarr)  ' copy output array to "Style wise Summary"
    
    End With
    
    ws2.Activate
    
    End Sub
    
    Sub Get_Data()
    '
    ' Get_data Macro
    '
     Dim Inarr() As Variant
     Dim InRng As Range
     Dim ws1 As Worksheet
     Dim ws2 As Worksheet
     Dim Current As Worksheet
     Dim Cmonth As String
     
     
    
             Set ws1 = Worksheets("Style Wise Summary")
             Set ws2 = Worksheets("Data")         ' Collate all data onto this sheet
             ws2.Range("A2:Y5000").ClearContents  ' clear data Sheet
             Cmonth = ws1.Range("A1")             ' Month name of tabs
    
             ' Loop through all of the worksheets in the active workbook.
             
             nextr = 2
             
             For Each Current In Worksheets
             
                If InStr(1, Current.Name, Cmonth) Then ' If this a "month" sheet then extract data ...
                    With Current
                        lr = .Cells(Rows.Count, "A").End(xlUp).Row          ' Last row of input sheet
                        .Range("A4:Y" & lr).Copy
                        ws2.Range("A" & nextr).PasteSpecial xlPasteValues    ' Copy/paste values
                        nextr = ws2.Cells(Rows.Count, "A").End(xlUp).Row + 1 ' Next row in input sheet
                    End With
                End If
             Next
    
        ws2.Activate
        
        lr = ws2.Cells(Rows.Count, "A").End(xlUp).Row  ' Last row in "Data" tab
        '
        '  Sort by Line ID then Style
        '
        Application.CutCopyMode = False
        ActiveWorkbook.Worksheets("Data").Sort.SortFields.Clear
        ActiveWorkbook.Worksheets("Data").Sort.SortFields.Add Key:=Range("A2:A" & lr) _
            , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        ActiveWorkbook.Worksheets("Data").Sort.SortFields.Add Key:=Range("B2:B" & lr) _
            , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
        With ActiveWorkbook.Worksheets("Data").Sort
            .SetRange Range("A2:Y" & lr)
            .Header = xlGuess
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
            .Apply
        End With   
        
    End Sub
    Sheet "Data" is an extract of data from all the sheets (do NOT delete this sheet)
    Last edited by JohnTopley; 05-18-2018 at 02:26 AM.

  13. #13
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Hi John, it looks great and highly appreciate your hard work. I will take some time to check for any issues.

    A few things I want to know;

    >> I am going to use this program when each factory sends me the final shet (end of the month). In this case, what should I do? I mean, can I simply copy the macro to " summary sheet"? then will it work without any issue?
    >> Does the "run" button work on both "summary sheet" and "data" sheet" when it is clicked?
    >> Do I need to change anything when the a "new month" (ex: June, July etc.) data to be analyzed? Because, we create "a new work sheet" for each month, starting from first day of the month.
    >> Can I add more rows(depending on the necessity) to the "daily record update sheets"? and what if I delete rows from the "daily data update sheets"

  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,781

    Re: Summary of daily data based on different criteria

    Code is installed in "Module1": instructions below (for EACH workbook)

    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Press Alt+F11 to open the Visual Basic Editor
    Choose Insert > Module
    Edit > Paste the macro into the module that appeared
    Close the VBEditor
    Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)
    [B][I]


    RUN button does everything. Ensure there is a "Data" tab in each workbook.

    Month is in cell A1 (as per sample). Just change this BUT it must the same as on the tabs. I recommend you use "Jan","Feb" etc as the months


    You can/add delete rows at will BUT do NOT put any other data below those data columns: it is bad practice.


    AND as previously requested, PLEASE remove all confidential data from files posted to this forum. I would remove all the files you have posted on this thread. I will remove the ones I posted.

  15. #15
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    I followed your instruction and used the code for another work book, but it didn't work properly.
    I have little knowledge about macro work outs.

    By the way, I also have few questions;

    >> Do I need to copy and paste the "Page format" also in the new work book? , I mean column labels, colors, fonts etc..?
    >> Should the "Data" tab always be at the end of the work sheets? and "Style Wise Summary" sheet in the same location?
    >> "do NOT put any other data below those data columns: it is bad practice",..which data columns do you mean?

    I have attached the work book I tried out, pls let me know the mistakes I have done.

  16. #16
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    One more question;
    What if I move "all the data tabs" of of other work books to this VBA modue, without trying to insert macro to each work book?

    I can delete all the tabs leaving only "Style Wise Summary" and "Data" tabs in the VBA macro module(original module), and insert all the data tabs of a different work book in between...will it work??

  17. #17
    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,781

    Re: Summary of daily data based on different criteria

    It will work: if you select a month in A1 then it will work on all tabs which contain that name so you could have all months in one workbook.

    Change one of the May tabs to JUN e.g "3 May" to "3 Jun" , change A1 to Jun and then click "RUN".

  18. #18
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Quote Originally Posted by JohnTopley View Post
    It will work: if you select a month in A1 then it will work on all tabs which contain that name so you could have all months in one workbook.

    Change one of the May tabs to JUN e.g "3 May" to "3 Jun" , change A1 to Jun and then click "RUN".
    I deleted the sheet tabs leaving only "style wise summary" and "data" tabs in the macro enabled module and inserted sheet tabs from a different work book in between, and ran the macro. However, it didn't change the data in the "style wise summary", but some data seemed to have change in the "data" sheet tab.

    Also, it gives error code "1004"...

    I have attached the work sheet I tried out..
    Last edited by Anuru; 05-18-2018 at 05:26 AM.

  19. #19
    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,781

    Re: Summary of daily data based on different criteria

    You totally ignore that I said there was to no data in column A or merged cells.

    The problem is simple due to "corrupt" data which also appeared to have corrupted "Data" : I had to unmerge in all sheets.

    I also note there are empty sheets which I do not test for as I assumed there always be data and only lines used would appear in column A.

    AND you still post files with confidential data.

    Clean up your data.

  20. #20
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    I was stupid not to see the merged cells hidden at the bottom of the sheet. I un merged all and deleted information on the column A. Now It worked. By the way, what if there is an empty row in the sheet tabs (daily data tabs)?

  21. #21
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Hi John, I am getting some "warning" when I save the document..pls advise ..attached the screen shot...
    Attached Images Attached Images

  22. #22
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    I have attached here the work book to see how the duplicating happens. In the 3 May, I have added two blank rows whose customer name has been selected. Now, you can see in the Style Wise Summary, AWS-9036MN appears two times.

    However, this can be sorted out by myself by not leaving any blank rows with the customer name selected. (attached the sheet)

    I need a solution only now for the "Number of Days run".

    This is my requirement
    I would like "Number of Days Run" to be the number of "calendar days" the particular style has run in that "particular month". The reason, is I need to calculate the Loss and profit of the style "based on the number of days" that particular style has run in the particular month.

    Accordingly, AWS-9036MN has run 10 days in the month of May. However, style wise summary shows a different value.

  23. #23
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Also, I have noticed another issue in the column "W of" the "Style wise Summary".
    Actually, in the column "Total Losses" should count the values in column "Z". The logic should be the same as columns K, M, N, O, P, Q etc..
    Total losses doesn't mean the "cumulative losses" of all the styles..

  24. #24
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Quote Originally Posted by Anuru View Post
    Also, I have noticed another issue in the column "W of" the "Style wise Summary".
    Actually, in the column "Total Losses" should count the values in column "Z". The logic should be the same as columns K, M, N, O, P, Q etc..
    Total losses doesn't mean the "cumulative losses" of all the styles..
    I saw, the columns J, L and T (average value columns) have the same issue. I meant "cumulative average" only of that style as per the number of days run. All averages should be only the average according to the number of days those styles were run in a particular line.

  25. #25
    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,781

    Re: Summary of daily data based on different criteria

    Updated: I added logic to remove "blank" lines from "Data" (as your data collection is so variable)

    I will post code when you confirm it is OK.
    Attached Files Attached Files

  26. #26
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    I checked the work sheet, and seems ok as per my requirement.
    However, still column W(total losses) of "style wise summary" not corrected. It should also follow the same logic as in columns M, N, O, P, Q etc...Pls re look at it...

  27. #27
    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,781

    Re: Summary of daily data based on different criteria

    You should be able to calculate with formula from columns U & V ????

  28. #28
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Quote Originally Posted by JohnTopley View Post
    You should be able to calculate with formula from columns U & V ????
    No John, this column should also follow the logic of M, N, O, P Q etc (total values). A formula is not necessary, because the details are captured from daily data sheets (same as total production, total working hours etc). The Column Z is the target column from the daily sheets. Normally, this doesn't include losses daily basis, it include losses only if they occurs.

  29. #29
    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,781

    Re: Summary of daily data based on different criteria

    See attached updated:
    Attached Files Attached Files

  30. #30
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Hi John,
    I think now everything is working fine.
    Just one more help is needed for the following req.

    >> There is a column wise summary in every "daily sheet tab" in the row no 24 of every sheet. Also, there is a "Daily Summary" sheet tab which summarize this information in the row 24 of each sheet. Currently, I do this manually by copying required fields from row 24 to daily summary sheet as per the date. I transfer only the information highlighted in RED from row 24 to the daily summary sheet. There are some other columns that we have to manually fill, and formulas are not required for them.

    Can you please provide me some formulas to do this?
    Attached Files Attached Files

  31. #31
    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,781

    Re: Summary of daily data based on different criteria

    TRY

    in B2

    =IFERROR(INDEX(INDIRECT("'" & TEXT($A3,"D")&"-" & TEXT($A3,"mmm") &"'!$A$24:$Z$24"),,MATCH('Daily Summary'!B$2,INDIRECT("'" & TEXT($A3,"D") & "-" & TEXT($A3,"mmm") &"'!$A$3:$Z$3"),0)),"")

    Copy across and down
    Attached Files Attached Files

  32. #32
    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,781

    Re: Summary of daily data based on different criteria

    You have 2 "Profit and Loss" on the Daily sheets but only one on the Daily Summary.

    NOTE: it is necessary for column headings in the Daily Sheets and the Daily Summary sheet to match.

  33. #33
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Quote Originally Posted by JohnTopley View Post
    You have 2 "Profit and Loss" on the Daily sheets but only one on the Daily Summary.

    NOTE: it is necessary for column headings in the Daily Sheets and the Daily Summary sheet to match.
    Yes John. The reason is Profit / Loss Status (BE) which is in column "Z" is just an extra information that this company doesn't have any interest, but in other cases, this is very much essential.

    Therefore, I keep only the "Profit / Loss Status (CM). But, I develop these sheets based on common industry norms so that I may use them in other cases.

    If you need the column heading to match, no problem you may change as required pls.
    Last edited by Anuru; 05-18-2018 at 12:24 PM.

  34. #34
    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,781

    Re: Summary of daily data based on different criteria

    So do you want "Profit / Loss Status (CM)" in the Daily Summary??

    If so, change heading in "Daily Summary"

    And change spelling of "Efficiency" w/book wide!

  35. #35
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Quote Originally Posted by JohnTopley View Post
    TRY

    in B2

    =IFERROR(INDEX(INDIRECT("'" & TEXT($A3,"D")&"-" & TEXT($A3,"mmm") &"'!$A$24:$Z$24"),,MATCH('Daily Summary'!B$2,INDIRECT("'" & TEXT($A3,"D") & "-" & TEXT($A3,"mmm") &"'!$A$3:$Z$3"),0)),"")

    Copy across and down
    Hi john, everything works fine. Thanks a lot again for this great and brilliant work sheet.

  36. #36
    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,781

    Re: Summary of daily data based on different criteria

    So are you leaving it "fixed" on line 24?

  37. #37
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    this message was removed.
    Last edited by Anuru; 05-19-2018 at 09:00 AM.

  38. #38
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    this message was removed.
    Last edited by Anuru; 05-19-2018 at 09:00 AM.

  39. #39
    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,781

    Re: Summary of daily data based on different criteria

    I do understand the requirement: please give me some credit!

    Obviously they don't appear as the formula is currently "fixed" on row 24.

    I suggest you move those totals to row 4 and start the data in row 5. If not the formula is going to be somewhat more complex as we need to "match" the row starting from row 4 down.

  40. #40
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Quote Originally Posted by JohnTopley View Post
    I do understand the requirement: please give me some credit!

    Obviously they don't appear as the formula is currently "fixed" on row 24.

    I suggest you move those totals to row 4 and start the data in row 5. If not the formula is going to be somewhat more complex as we need to "match" the row starting from row 4 down.
    I understand John. But moving summary totals to the beginning of the table looks a bit odd.

  41. #41
    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,781

    Re: Summary of daily data based on different criteria

    Put "Daily Summary" in column B i.e. currently row 24

    in B3

    =IFERROR(INDEX(INDIRECT("'" & TEXT($A3,"D")&"-" & TEXT($A3,"mmm") &"'!$A$4:$Z$100"),MATCH("Daily Summary",INDIRECT("'" & TEXT($A3,"D") & "-" & TEXT($A3,"mmm") &"'!$B$4:$B$100"),0),MATCH('Daily Summary'!B$2,INDIRECT("'" & TEXT($A3,"D") & "-" & TEXT($A3,"mmm") &"'!$A$3:$Z$3"),0)),"")

  42. #42
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Quote Originally Posted by JohnTopley View Post
    Put "Daily Summary" in column B i.e. currently row 24

    in B3

    =IFERROR(INDEX(INDIRECT("'" & TEXT($A3,"D")&"-" & TEXT($A3,"mmm") &"'!$A$4:$Z$100"),MATCH("Daily Summary",INDIRECT("'" & TEXT($A3,"D") & "-" & TEXT($A3,"mmm") &"'!$B$4:$B$100"),0),MATCH('Daily Summary'!B$2,INDIRECT("'" & TEXT($A3,"D") & "-" & TEXT($A3,"mmm") &"'!$A$3:$Z$3"),0)),"")
    Thanks John. It worked and done.

  43. #43
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    The column shifting issue looks to be ok.

    I just found a little problem in the "Style wise summary". In line no H2, "Days Run" should be 3, but it is showing 1. I found this error when put 1,2,3 etc to "Days run" in all sheet tabs for checking purpose. Pls check..I have highlighted this in red. Pls see the attached work book.

    However, in the Data sheet, Days run for H2 line is showing correct...

  44. #44
    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,781

    Re: Summary of daily data based on different criteria

    Again see attached ...

    I added sheet "Data Mapping" which shows correspondence between "Data" columns "Summary" columns

  45. #45
    Forum Contributor
    Join Date
    12-06-2013
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2016
    Posts
    613

    Re: Summary of daily data based on different criteria

    Quote Originally Posted by JohnTopley View Post
    Again see attached ...

    I added sheet "Data Mapping" which shows correspondence between "Data" columns "Summary" columns
    It looks OK now.
    By the way, what does the "Data Mapping" do? Does it help macro to identify the columns that should not be counted?

  46. #46
    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,781

    Re: Summary of daily data based on different criteria

    The "Data Mapping" is mainly for my benefit in case you have other amendments!

    There an array (IDX) in the VBA which is effectively the mapping and it would be possible to incorporate the Data Mapping into the VBA but I have no plans to do so!

+ 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. [SOLVED] Look up and sum daily data to weekly summary
    By Spamanda in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-11-2016, 01:27 PM
  2. Transfer Daily Data from Daily Staffing Workbooks into a Running Annual Summary Workbook
    By nurseydiamond in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-07-2015, 07:05 PM
  3. [SOLVED] Summary of data based on multiple criteria
    By Reapz in forum Excel General
    Replies: 2
    Last Post: 09-16-2015, 06:46 PM
  4. Extracting data from a range that changes daily based on a cells criteria
    By JohnnyBoyxxx in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-02-2014, 02:35 AM
  5. Generating a data summary sheet based on multiple criteria
    By Anuru in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 07-18-2014, 08:03 PM
  6. [SOLVED] Extracting data from summary tab to different tabs based on criteria
    By masond3 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-02-2013, 05:47 AM
  7. need help with data summary based on a daily basis
    By randypang in forum Excel General
    Replies: 1
    Last Post: 04-26-2013, 11:45 PM

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