Kombinera 4 ark - Excel-tips

Excel kombinerar flera kalkylblad i ett enda kalkylblad. Varje kalkylblad kan ha olika antal poster från dag till dag, så formler är inte vägen att gå. Istället låter ett lite känt verktyg som heter Power Query dig slå samman data enkelt och snabbt.

Kolla på video

  • Doug: Hur kombinerar man fyra ark där var och en har olika antal rader?
  • Använd Power Query
  • Formatera varje kalkylblad som en tabell med Ctrl + T
  • Byt namn på tabellerna
  • För varje tabell ny fråga från tabell. Lägg till en anpassad kolumn för Region
  • Istället för Stäng & Ladda, välj Stäng & Ladda till … Skapa bara en anslutning
  • Använd ny fråga, kombinera fråga, lägg till. 3 eller fler tabeller. Välj tabeller och lägg till
  • Stäng och ladda och data visas i ett nytt kalkylblad
  • För den ena tabellen med extra kolumn: data visas endast för arkets poster
  • För den ena tabellen där kolumnerna var i fel ordning: Power Query fungerade korrekt!
  • Lätt att uppdatera senare

Autogenererat avskrift

  • Lär dig Excel från Podcast Episode
  • 2178 slås samman för kalkylblad idag
  • fråga via YouTube från Doug har detta
  • situation vi har fyra ark där vardera
  • är en region med försäljningsdata och
  • antalet poster ändras varje månad och
  • just nu försöker Doug använda formler
  • men när antalet rader ändrade det
  • blir en mardröm rätt så jag sa hej
  • Doug kan vi använda strömfråga om du har
  • Excel 2010 eller Excel 2013 är gratis
  • ladda ner från Microsoft eller så är det byggt
  • till 2016 och office 365 står det ja alla
  • rätt så här är vad vi har vi har
  • fyra rapporterar den centrala regionen öst
  • region södra regionen och väst
  • region och var och en har olika
  • antal poster som här i söder
  • Region vi har 72 poster i öster
  • region 193 poster och detta kommer att
  • ändra rätt
  • varje gång vi kör denna rapport kommer att ha
  • ett annat antal poster nu har jag
  • gjorde några antaganden här först det
  • det finns inte en kolumn som heter central och
  • då kommer jag också att bli helt ond
  • här och ta den södra regionen jag vill
  • försök att skruva upp det jag ska ta
  • vinst kolumn klippa det och klistra in det hur man
  • vänd dem och sedan okej så att vi
  • har en där kolumnerna är omvända
  • och sedan en till där vi ska
  • lägga till en extra kolumn bruttovinstprocent
  • så detta kommer att vara vinst dividerat med
  • intäkter i en idealisk värld är allt detta
  • formade exakt samma men som jag lärde mig
  • nyligen gjorde jag ett seminarium nere i
  • North Carolina om de inte är okej
  • någon hade en situation som du vet
  • halvvägs genom året förändrades saker
  • och de lade till en ny kolumn eller flytta
  • kolumner runt var vi verkligen glada att
  • se att kraftförfrågan kunde hantera
  • med det här okej så ska vi ta
  • vart och ett av dessa rapporter och göra det till
  • ett officiellt bordsformat som tabell så
  • det är kontrollte eller så kan du använda en
  • namnintervall för mig kontroll t är
  • enklare sättet att gå och vad de gör här
  • kallar de det här bordet jag ska
  • byta namn på detta för att kallas centralt och
  • sedan fortsätter vi till östkontrollen T klickar på OK
  • och detta kommer att kallas öst nu hej
  • på en tidigare podcast visade jag hur om
  • det har varit fyra separata filer vi
  • kunde ha använt strömförfrågan bara för att
  • kombinera filer men det fungerar inte när
  • de är fyra separata eller fyra kalkylblad
  • i samma bok så bra där vi
  • gå och sedan
  • som den här kontrollen-t lite tråkigt att
  • ställa in detta för första gången men pojke
  • det kommer att bli fantastiskt
  • varje gång du måste uppdatera detta senare
  • så vi ska göra är att vi ska
  • att välja detta första bord centralt
  • region och om du är 2010 eller 2013 och
  • nedladdad kraftfråga du kommer att bli det
  • kommer att ha sin egen flik men i 16 i
  • Excel 2016 blir faktiskt
  • transformerad vilket är den andra gruppen i
  • office 365 håller nu på att förändras
  • vilken är den första gruppen och så är vi
  • kommer att säga att de skulle skapa det här
  • data från en tabell eller intervall okej och
  • there is our data now we don't have a
  • region field and the combined files
  • would have added the region field so in
  • this case I'm just gonna add a column a
  • new custom call the headings gonna be
  • region and this one is going to be what
  • was this central right like that
  • click OK alright now here's the
  • important part when we're done this with
  • this we're gonna go home not choose
  • close and load we're gonna open the
  • drop-down close and load to only create
  • a connection click OK
  • perfect we have our connection only now
  • the next thing we have to do is repeat
  • these steps for the next three regions
  • and now that would be really a bit
  • boring to you so let's just speed up the
  • video to 10x for this
  • alright there we are for connections set
  • up now here's where we're going to do
  • the magic I'm gonna insert a new blank
  • worksheet and I'm gonna say get data
  • combine queries and I want to append two
  • queries from this workbook and I'm gonna
  • say three or more tables and the
  • available tables are Central through
  • West click Add BAM click OK and then we
  • can close and load and what we have here
  • is we have a superset of all of the
  • records in all of the tables all right
  • and where we tried to screw it up where
  • I purposely tried to screw up by
  • reversing cost of goods sold and profit
  • down in what was that that was Central
  • East South in the South Region I'll just
  • go check those right and it looks like
  • yeah generally feels right they used the
  • heading to figure it out because the
  • profit is always higher than cost of
  • goods sold and so that worked and then
  • down here in the West where we added
  • gross profit percent we actually get
  • that data for the tables that had it and
  • for the tables that didn't have it we
  • just get null which is perfect alright
  • now duck
  • here's what you're gonna do so the next
  • time that you have some more data and
  • I'll just let's create some some extra
  • records here we'll just add some ABC
  • with a date of today and all retail and
  • it's called Doug's new records and just
  • some garbage out here let's just put in
  • a hundred all the way across in the
  • interest of time okay so now because
  • this is a table the table automatically
  • expands to the new records which is
  • beautiful had they been named range I
  • would have had a redefine that's why I
  • really like the table instead of the
  • name range but we come back here to the
  • resulting workbook with 563 rows loaded
  • and I click refresh
  • and bam now I have 572 Rose loaded
  • including let's see if we can find them
  • in here
  • Doug's new records right there at the
  • end of the South Region
  • isn't that just an awesome awesome way
  • to go yes it definitely takes longer to
  • set up the first day we're up to seven
  • minutes already if I hadn't sped that up
  • to 10x but once it's set up now life is
  • gonna be super super easy from here on
  • out way this is where I usually promote
  • my own book but no this time let's talk
  • about this awesome book Emma's for data
  • monkey by Ken polls in Miguel Escobar
  • everything I learned about power query I
  • learned from this book look at the eye
  • on the top right hand corner for more
  • information about that book all right
  • wrap up topics in this episode Doug how
  • to combine four sheets where each sheet
  • has a different number of rows we can
  • use power query make sure to format each
  • worksheet as a table with ctrl T or use
  • named ranges but I prefer ctrl T rename
  • the tables from each table choose new
  • query from table add a custom column for
  • a region and then instead of close and
  • load choose close and load to only
  • create a connection do that for all four
  • queries and then new query combined
  • query append choose three or more tables
  • choose the tables and click Add
  • now some older versions of power query
  • you couldn't do three or more tables you
  • have to do two and then do another query
  • to add the third one and then do another
  • query to add the fourth one either way
  • it would be more hassle that way I'm
  • glad that they added the three or more
  • tables close and load this time close
  • and load to the worksheet and and then
  • later on if you add more data to any of
  • the four tables just go back to your
  • query and click refresh and you're good
  • to go
  • power query and amazing new feature from
  • Microsoft I love it I thank Doug for
  • säger den frågan det bra tack
  • för att stanna förbi ses vi nästa gång
  • för en annan nätgjutning från

Nedladdning fil

Ladda ner exempelfilen här: Podcast2178.xlsm

Intressanta artiklar...