Excel kombinuje několik listů do jednoho listu. Každý list může mít ze dne na den jiný počet záznamů, takže vzorce nejsou správnou cestou. Místo toho vám málo známý nástroj s názvem Power Query umožní jednoduše a rychle sloučit data.
Sledovat video
- Doug: Jak kombinovat čtyři listy, kde každý má jiný počet řádků?
- Použijte Power Query
- Naformátujte každý list jako tabulku pomocí Ctrl + T
- Přejmenujte tabulky
- Pro každou tabulku nový dotaz z tabulky. Přidejte vlastní sloupec pro Region
- Místo Zavřít a načíst zvolte Zavřít a načíst do … Vytvořit pouze připojení
- Použít nový dotaz, kombinovat dotaz, připojit. 3 nebo více tabulek. Vyberte tabulky a přidejte
- Zavřete a načtěte a data se zobrazí na novém listu
- U jedné tabulky se sloupcem navíc: data se zobrazují pouze u záznamů daného listu
- Pro jednu tabulku, kde byly sloupce ve špatném pořadí: Power Query fungoval správně!
- Snadné obnovení později
Automaticky generovaný přepis
- Naučte se Excel z epizody podcastu
- 2178 sloučí pro dnešní pracovní listy
- Doug prostřednictvím YouTube má toto
- máme čtyři listy, kde každý
- list je region s údaji o prodeji a
- počet záznamů se mění měsíčně a
- právě teď se Doug pokouší používat vzorce
- ale když to počet řádků změnil
- stává se noční můrou, tak jsem řekl hej
- Doug, můžeme použít dotaz na moc, pokud máte
- Excel 2010 nebo Excel 2013 je zdarma
- stáhnout z Microsoftu nebo je postaven
- do roku 2016 a Office 365 říká ano
- správně, takže tady máme to, co máme
- čtyři hlásí střední region na východě
- region jižní region a západ
- regionu a každý má jiný
- počet záznamů jako tady na jihu
- Na východě máme region 72 záznamů
- region 193 záznamů a toto bude
- změnit správně
- pokaždé, když spustíme tuto zprávu, bude mít
- teď mám jiný počet záznamů
- nejdříve zde učinil několik předpokladů
- neexistuje sloupec s názvem centrální a
- pak také budu úplně zlý
- tady a vezměte si jižní region, který chci
- zkus to pokazit, vezmu si
- sloupec zisku rozřízněte a vložte jak
- zvrátit je a pak v pořádku, takže my
- mít jeden, kde jsou sloupce obrácené
- a pak další, kam se chystáme
- přidat další sloupec hrubého procenta zisku
- takže tohle bude zisk děleno
- příjmy v ideálním světě to jsou všechno
- ve tvaru úplně stejné, ale jak jsem se dozvěděl
- nedávno jsem dělal seminář dole v
- Severní Karolína, pokud nejsou v pořádku
- někdo měl situaci dobře, víte
- v polovině roku se věci změnily
- a přidali nový sloupec nebo přesun
- sloupce kolem nás byli opravdu rádi
- vidět, že moc dotaz byl schopen vypořádat
- s tímto v pořádku, takže si vezmeme
- každou z těchto zpráv a provést ji
- oficiální formát tabulky jako tabulka tak
- to je kontrolní čaj, nebo můžete použít a
- rozsah jmen pro mě ovládání t je
- jednodušší způsob, jak jít a co zde dělají
- říkají tomu stolu jeden?
- přejmenujte toto na centrální a
- pak přejdeme na východní ovládání T a klikneme na OK
- a tohle se teď bude jmenovat východ hej
- na dřívějším podcastu jsem ukázal, jak kdyby
- to byly čtyři samostatné soubory
- mohl použít power query jen k
- kombinovat soubory, ale to nefunguje, když
- jsou to čtyři samostatné nebo čtyři pracovní listy
- ve stejné knize, tak dobře, že jsme
- jdi a pak
- jako je toto ovládání - trochu zdlouhavé
- nastavit to poprvé, ale chlapče
- bude to úžasné
- pokaždé, když to budete muset později aktualizovat
- dál, takže uděláme, že půjdeme
- zvolit tento první centrální stůl
- regionu a pokud jste v roce 2010 nebo 2013 a
- stažený dotaz na výkon
- bude mít vlastní záložku, ale v 16 palcích
- Excel 2016 ve skutečnosti začíná
- transformována, což je druhá skupina v
- Office 365 se nyní transformuje
- což je první skupina a tak jsme
- řeknu, že to vytvoří
- data z tabulky nebo rozsahu v pořádku a
- 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
- říkám tu otázku dobře, děkuji
- pro zastavení se uvidíme příště
- pro další obsazení sítě z
Stáhnout soubor
Stáhněte si ukázkový soubor zde: Podcast2178.xlsm