Combine All Excel files in one folder daily

BVL

New Member
Joined
Dec 13, 2019
Messages
8
Office Version
  1. 2016
Platform
  1. Windows
Hi All,
We have an Excel overview of all the orders our customers create. These orders create a to do list for our drafters to create productdrawings. This overview is updated daily by extracting data from our ERP system, new orders are added and finished orders are deleted. Orders that are not finished get an increment of "+1" in column L "#days in" (=number of days in the list).
I would like to keep track of the number of days our drafters (and other teammembers) need to create those drawings on a monthly basis, I want to use this to create transparency within our company of the average processing time. Can you help me?
Setup:
The drafters extract the orders on a daily basis from our ERP system and update a list that looks like <"Drafter list_Master.xlsx" sheet:"list">. By executing that macro action they also create a copy (archive) to "S:\Drafters\List\Archive". This folder contains hundreds of files named "Drafter list_date x.xlsx" (-> date x= 12/12/2019, 13/12/2019, 14/12/2019, and so on)
I would like to keep track of the "#days in", so we can see when the workload explodes and when we need to add drafters to cope with the workload.
I've added a picture "Pivotchart" that is linked to "Result" that shows what I'm after: a graph that visualizes the average "#days in" and the maximum "#days in". [column F checks whether the order is still in process or finished, but there are probably better ways?]
The tricky part for me is the combination of all those files into 1 file? Possibly the macro that extracts data and creates an archive copy could be a good way to go, though a separate macro and file is also an option.

My level: I have no experience in writing macros, but I have basic knowledge in SQL.

<"Drafter list_Master.xlsx" sheet:"list">
Item NumberDRAWINGNameP/MStOrderLnExt PriceQty OrderedRemarksProm#days in
10101aaNCS2190967101.001.0CSP13-Dec-1925
11102bbncB219141511.0010.030-Dec-196
12103aancS219141521.0010.030-Dec-196
13104bbNS219148611.005.013-Jan-203
14105aaNB219148621.005.013-Jan-203
15106bbNS219148631.005.013-Jan-203
16107aaNS219145911.002.017-Jan-203
17108bbNS2191462351.0029.020-Jan-203
18109aaNT2191478101.006.020-Jan-203
19110bbNS21914782701.005.020-Jan-203
20111aaNS2191478201.006.020-Jan-203
21112bbNS21914782801.005.020-Jan-203
22113aaNCS2191462231.0020.020-Jan-203
23114bbNCS2191462211.005.020-Jan-203
24115aaNS219146281.005.020-Jan-203
25116bbNT219146211.003.020-Jan-203
26117aaNCS2191480101.001.0CSP27-Jan-203
27118bbNCS2191475681.0010.025-Mar-203
28119aaNS21914751011.0075.025-Mar-203
29120bbNCS21914751401.0010.025-Mar-203
30121aaNCB21914751671.005.025-Mar-203
31122bbNCB2191475211.0090.025-Mar-203
32123aaNCS2191475251.005.025-Mar-203
33124bbNCS2191475151.0020.025-Mar-203
34125aaNCS219148211.002.0General16-Jan-202

<"Drafter list_Master.xlsx" sheet:"Result">
DateOrderNameProm#days inFinish date ("=IF(G2=B2,"",A2)")"=IFERROR(VLOOKUP(B2,B3:B19,1,FALSE),A2)"
16/12/2019​
B2191415bb30-Dec-196
16/12/2019​
16/12/2019​
16/12/2019​
B2191486aa13-Jan-203B2191486
16/12/2019​
T2191478aa20-Jan-203T2191478
16/12/2019​
T2191462bb20-Jan-203T2191462
16/12/2019​
B2191475aa25-Mar-203B2191475
16/12/2019​
B2191475bb25-Mar-203B2191475
17/12/2019​
B2191486aa13-Jan-204
17/12/2019​
17/12/2019​
17/12/2019​
T2191478aa20-Jan-204
17/12/2019​
17/12/2019​
17/12/2019​
T2191462bb20-Jan-204
17/12/2019​
17/12/2019​
17/12/2019​
B2191475aa25-Mar-204B2191475
17/12/2019​
B2191475bb25-Mar-204B2191475
17/12/2019​
T2201234cc20-Jan-201T2201234
18/12/2019​
B2191475aa25-Mar-205B2191475
18/12/2019​
B2191475bb25-Mar-205
18/12/2019​
18/12/2019​
18/12/2019​
T2201234cc20-Jan-202
18/12/2019​
18/12/2019​
18/12/2019​
B2201235cc21-Jan-201
18/12/2019​
18/12/2019​
18/12/2019​
B2201236cc22-Jan-201
18/12/2019​
18/12/2019​
18/12/2019​
B2201237cc23-Jan-201
18/12/2019​
18/12/2019​
 

Attachments

  • PivotChart.PNG
    PivotChart.PNG
    16.6 KB · Views: 2

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
@sandy666 Power Query works like a charm! But now I've got a small fine-tuning question. I now have a long list that looks like <"Drafter list_Master.xlsx" sheet:"Result"> except the first column "Date", which I use to combine values in the Pivot Chart. In my source file I have the column "Source.Name" which I use together with "Add column>from text>extract>range" to extract the date "ddmmyyyy". For easier manipulation in excel (and the Pivot Chart) I'd like to convert this text "ddmmyyyy" to a date "dd/mm/yyyy", but using the power query function "transform>data type: date" gives an Error. Are there (easy) workarounds in Power Query?
I'd prefer not to do this in Excel since now I can just do a simple refresh in Excel to update my data instead of performing additional actions to clean up that data. (every day)
 
Upvote 0
See power query sample below
 

Attachments

  • 2019-12-16_16-46-00.jpg
    2019-12-16_16-46-00.jpg
    87.7 KB · Views: 3
Upvote 0
you can adapt this code
Rich (BB code):
let
    Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
    Type = Table.TransformColumnTypes(Source,{{"DayMonthYear", type text}}),
    Insert = Table.AddColumn(Table.AddColumn(Type, "Custom", each Text.Insert([DayMonthYear],2,"/")), "Custom.1", each Text.Insert([Custom],5,"/")),
    Date = Table.TransformColumnTypes(Table.RenameColumns(Table.SelectColumns(Insert,{"Custom.1"}),{{"Custom.1", "DayMonthYear"}}),{{"DayMonthYear", type date}})
in
    Date
then move result column to correct place
 
Last edited:
  • Like
Reactions: BVL
Upvote 0
or better this one
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table3"]}[Content],
    Type = Table.TransformColumnTypes(Source,{{"DayMonthYear", type text}}),
    Insert = Table.AddColumn(Table.AddColumn(Type, "Custom", each Text.Insert([DayMonthYear],2,"/")), "Custom.1", each Text.Insert([Custom],5,"/")),
    DMY = Table.RenameColumns(Table.TransformColumnTypes(Table.RemoveColumns(Insert,{"DayMonthYear", "Custom"}),{{"Custom.1", type date}}),{{"Custom.1", "DayMonthYear"}})
in
    DMY
 
  • Like
Reactions: BVL
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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