SOLVED

Transfer and changing data with two different Excel sheets

%3CLINGO-SUB%20id%3D%22lingo-sub-2659894%22%20slang%3D%22en-US%22%3ETransfer%20and%20changing%20data%20with%20two%20different%20Excel%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2659894%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EWhat%20is%20the%20smartest%20way%20to%20transfer%20data%20from%20one%20spreadsheet%20to%20another%20but%20not%20take%20the%20whole%20information%20from%20one%3F%20I%20have%20one%20spreadsheet%20with%20information%20and%20need%20to%20transfer%20only%20some%20information%20to%20another%20one%20spreadsheet.%20Hope%20this%20makes%20sense.%20Thanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2659894%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2660029%22%20slang%3D%22en-US%22%3ERe%3A%20Transfer%20and%20changing%20data%20with%20two%20different%20Excel%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2660029%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1131204%22%20target%3D%22_blank%22%3E%40scaffoold2021%3C%2FA%3E%26nbsp%3BThat's%20a%20broad%20question.%20%22Transfer%20only%20some%20information%20to%20another%20spreadsheet%22.%20Would%20that%20be%20a%20particular%20range%2C%20or%20groups%20of%20cells%20spread%20out%20all%20over%20the%20place%3F%20Show%20us%20what%20you%20are%20dealing%20with%20and%20I'm%20sure%20you'll%20get%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2660053%22%20slang%3D%22en-US%22%3ERe%3A%20Transfer%20and%20changing%20data%20with%20two%20different%20Excel%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2660053%22%20slang%3D%22en-US%22%3EThank%20you%20for%20your%20help%2C%20and%20yes%20it%20was%20not%20good%20stated.%20But%20if%20I%20have%20work%20numbers%20(excelsheet1)%20on%20one%20of%20my%20spreadsheet%2C%20and%20every%20week%20I%20get%20new%20information%20from%20a%20new%20spreadsheet%20(excelsheet2)%20with%20hours%20worked%20on%20that%20work%20number.%20Instead%20of%20manually%20type%20in%20every%20hour%20for%20that%20specific%20work%20number%2C%20can%20I%20use%20IF%20statements%20to%20transfer%20the%20data%3F%20Simply%20IF%23%20on%20(excelsheet2)%20match%20with%20(excelsheet1)%20then%20add%20hours%20of%20work%20to%20that%20work%20number.%3CBR%20%2F%3E%3CBR%20%2F%3EThank%20you%20for%20your%20reply.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2696299%22%20slang%3D%22en-US%22%3ERe%3A%20Transfer%20and%20changing%20data%20with%20two%20different%20Excel%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2696299%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3B%20Been%20trying%20this%20out%20for%20a%20week%20now%20with%20any%20success.%20Both%20trying%20to%20learn%20PowerQuery%20and%20testing%20it%20in%20Power%20BI.%20But%20I%20attached%20two%20files.%3CBR%20%2F%3ESo%20to%20explain%2C%20I%20get%20Sheet1%20with%20updated%20data%20every%20week%2C%20and%20Sheet2%20is%20where%20I%20want%20to%20add%2Ftransfer%2Fdelete%20the%20data%20based%20on%20Sheet1.%20So%2C%20for%20the%20second%20row%20in%20Sheet1%20the%20%22WorkNr%22%20matches%20a%20%22WorkNr%22%20in%20Sheet2%2C%20then%20I%20want%20to%20add%20the%20Hours%20Worked%20on%20to%20Sheet2%2C%20since%20the%20%22WorkNr%22%20matched.%20And%20that%20goes%20for%20row%205%2C8%2C11(from%20Sheet1)%20as%20well%20since%20the%20%22WorkNr%22%20match.%20But%20for%20row%2014%20there%20is%20a%20new%20WorkNr%20that%20doesn't%20match%20any%20WorkNr%20in%20Sheet2.%20I%20then%20want%20to%20add%20the%20new%20WorkNr%20on%20to%20Sheet2%2C%20with%20WorkNr%2C%20Hours%20Worked%2C%20Company%2C%20Place%20(the%20formatting%20I%20get%20from%20Sheet1%20is%20not%20ideal%2C%20but%20I%20found%20a%20way%20in%20Power%20Query%20to%20extract%20that%20into%20a%20new%20column%20for%20Company%2C%20and%20Place).%20Then%20for%20row%2014%2C%20and%2023%20(in%20Sheet1)%20they%20have%20matches%20with%20WorkNr%2C(twice%20job%20on%20that%20in%20one%20week)%20so%20all%20I%20want%20to%20do%20there%20is%20to%20add%20the%20total%20Work%20Hours%20to%20Sheet2.%20So%20in%20the%20end%2C%20if%20WorkNr%20match%2C%20only%20add%20hours%2C%20if%20WorkNr%20do%20not%20match%2C%20add%20a%20new%20row%20in%20Sheet2%20with%20all%20the%20criteria.%20So%20when%20automated%2C%20total%20work%20hours%20with%20matching%20WorkNr%20adds%20up%20to%20the%20total%20hours%20from%20Sheet1%20(this%20case%20272).%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EHope%20this%20makes%20some%20sense%20since%20I'm%20fairly%20new%20to%20the%20PowerQuery%2C%20PowerBI%20and%20Excel%20world.%3C%2FP%3E%3CP%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2696779%22%20slang%3D%22en-US%22%3ERe%3A%20Transfer%20and%20changing%20data%20with%20two%20different%20Excel%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2696779%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3BI%20truly%20appreciate%20your%20help.%20But%20to%20mention%2C%20the%20sheet2%20originally%20consist%20of%202000%20rows%20and%20sheet1%20with%20around%20300%20rows.%20Therefore%20I%20believe%20it%20would%20be%20a%20messy%20job%20to%20go%20that%20route.%20And%20since%20I'm%20fairly%20beginner%20I%20need%20to%20learn%20more%20formulas%20using%20DAX%2C%20working%20with%20Power%20BI%2C%20so%20the%20goal%20is%20to%20automate%20the%20process%20where%20sheet1%20gets%20applied%20to%20all%20the%20rules%20and%20formulas%20and%20after%20blend%20in%20with%20sheet2.%20But%20again%2C%20thanks%20for%20your%20help!%20And%20I'll%20get%20to%20work%20and%20learn%20the%20whole%20concept%20and%20trix%20to%20fix%20this%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Aslightly_smiling_face%3A%22%3E%3C%2FLI-EMOJI%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2717789%22%20slang%3D%22en-US%22%3ERe%3A%20Transfer%20and%20changing%20data%20with%20two%20different%20Excel%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2717789%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1131204%22%20target%3D%22_blank%22%3E%40scaffoold2021%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eyou%20need%20to%20provide%20two%20versions%20of%20sheet1.xls%2C%20the%20first%20version%20that%20have%20original%20worknr%20with%20the%20existing%20worknr%20in%20sheet2%20and%20the%202nd%20version%20that%20have%20worknr%20that%20does%20not%20exist%20in%20the%20first%20version%20(in%20order%20to%20test)%20and%201%20version%20of%20sheet%202%20or%20you%20can%20do%20the%20testing%20yourself%20since%20you%20already%20have%20the%20dataset%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2723574%22%20slang%3D%22en-US%22%3ERe%3A%20Transfer%20and%20changing%20data%20with%20two%20different%20Excel%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2723574%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1047584%22%20target%3D%22_blank%22%3E%40Yea_So%3C%2FA%3E%26nbsp%3BSo%20then%20when%20I%20have%202%20versions%20of%20sheet1%2C%20do%20I%20delete%20duplicates%3F%20Or%20how%20will%20I%20proceed%20to%20blend%20the%20data%20together%20with%20sheet2%3F%20Thanks%20for%20your%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi,

What is the smartest way to transfer data from one spreadsheet to another but not take the whole information from one? I have one spreadsheet with information and need to transfer only some information to another one spreadsheet. Hope this makes sense. Thanks

11 Replies

@scaffnull That's a broad question. "Transfer only some information to another spreadsheet". Would that be a particular range, or groups of cells spread out all over the place? Show us what you are dealing with and I'm sure you'll get help.

Thank you for your help, and yes it was not good stated. But if I have work numbers (excelsheet1) on one of my spreadsheet, and every week I get new information from a new spreadsheet (excelsheet2) with hours worked on that work number. Instead of manually type in every hour for that specific work number, can I use IF statements to transfer the data? Simply IF# on (excelsheet2) match with (excelsheet1) then add hours of work to that work number.

Thank you for your reply.

@scaffnull You could just create one file/table (cut and paste) with all weekly hours per job number and then summarize the lot with a pivot table. Or, if you want to avoid the manual copying and pasting, look into PowerQuery (PQ). Set up the correct routine(s) once and just add weekly data files to a particular folder on your system and refresh the query(ies). It is as easy as it sounds, BUT you need to learn some PQ basics first.

But, to be sure that these are indeed the smartest ways, please upload some sample data. Replace any confidential information with something that is made up.

 

 

@Riny_van_Eekelen  Been trying this out for a week now with any success. Both trying to learn PowerQuery and testing it in Power BI. But I attached two files.
So to explain, I get Sheet1 with updated data every week, and Sheet2 is where I want to add/transfer/delete the data based on Sheet1. So, for the second row in Sheet1 the "WorkNr" matches a "WorkNr" in Sheet2, then I want to add the Hours Worked on to Sheet2, since the "WorkNr" matched. And that goes for row 5,8,11(from Sheet1) as well since the "WorkNr" match. But for row 14 there is a new WorkNr that doesn't match any WorkNr in Sheet2. I then want to add the new WorkNr on to Sheet2, with WorkNr, Hours Worked, Company, Place (the formatting I get from Sheet1 is not ideal, but I found a way in Power Query to extract that into a new column for Company, and Place). Then for row 14, and 23 (in Sheet1) they have matches with WorkNr,(twice job on that in one week) so all I want to do there is to add the total Work Hours to Sheet2. So in the end, if WorkNr match, only add hours, if WorkNr do not match, add a new row in Sheet2 with all the criteria. So when automated, total work hours with matching WorkNr adds up to the total hours from Sheet1 (this case 272).

Hope this makes some sense since I'm fairly new to the PowerQuery, PowerBI and Excel world.

Thanks!

best response confirmed by scaffnull (Occasional Contributor)
Solution

@scaffnull Combined both sheets into one to make it easier to follow through the entire process. The attached file contains a "dirty" PQ solution that need optimizing. Bur just to be sure that the Invoice table is something you had in mind. Perhaps it enables you to continue with what you developed earlier. If not, come back here.

Screenshot 2021-08-29 at 16.57.32.png

@Riny_van_Eekelen I truly appreciate your help. But to mention, the sheet2 originally consist of 2000 rows and sheet1 with around 300 rows. Therefore I believe it would be a messy job to go that route. And since I'm fairly beginner I need to learn more formulas using DAX, working with Power BI, so the goal is to automate the process where sheet1 gets applied to all the rules and formulas and after blend in with sheet2. But again, thanks for your help! And I'll get to work and learn the whole concept and trix to fix this

@scaffnull 

 

you need to provide two versions of sheet1.xls, the first version that have original worknr with the existing worknr in sheet2 and the 2nd version that have worknr that does not exist in the first version (in order to test) and 1 version of sheet 2 or you can do the testing yourself since you already have the dataset

@Yea_So So then when I have 2 versions of sheet1, do I delete duplicates? Or how will I proceed to blend the data together with sheet2? Thanks for your help.

@scaffnull 

 

Never delete any business records unless you are absolutely sure that you do not need them anymore and one can only be sure of that is if when time passes maybe 15-30years as a general rule.

 

1. you combine both workbooks dynamically using power query

2. then you can decide which one you,re going to try first by formulas or by parameter queries

 

those are the two roads you can pick, choose one

@Yea_So Would always save a spare copy appreciate the tips, but will have to dig deeper into this since I have no idea how to use maybe DAX to write a statement to have (if 2 numbers match, then delete one of them and add hours).

Thanks again!

@scaffnull 

 

DAX is good for creating reports, but you have to have all dataset present to do calculations that is why you do not delete any of your dataset