Excel menggabungkan beberapa lembaran kerja menjadi satu lembaran kerja. Setiap lembaran kerja mungkin mempunyai jumlah rekod yang berbeza dari hari ke hari, jadi formula bukanlah cara yang tepat. Sebagai gantinya, alat yang kurang dikenali bernama Power Query akan membolehkan anda menggabungkan data dengan mudah dan cepat.
Tonton Video
- Doug: Bagaimana menggabungkan empat helai di mana masing-masing mempunyai bilangan baris yang berbeza?
- Gunakan Kueri Kuasa
- Format setiap lembaran kerja sebagai Jadual dengan Ctrl + T
- Namakan semula jadual
- Untuk setiap jadual, pertanyaan baru Dari Jadual. Tambahkan lajur tersuai untuk Wilayah
- Daripada Tutup & Muatkan, pilih Tutup & Muat ke… Hanya Buat Sambungan
- Gunakan Pertanyaan Baru, Gabungkan Pertanyaan, Lampirkan. 3 atau Lebih Jadual. Pilih Jadual dan Tambah
- Tutup dan Muatkan dan data muncul pada lembaran kerja baru
- Untuk satu jadual dengan lajur tambahan: data hanya muncul untuk catatan helaian itu
- Untuk satu jadual di mana lajur berada dalam urutan yang salah: Kuasa Kuasa berfungsi dengan betul!
- Mudah untuk Menyegarkan kemudian
Transkrip Dihasilkan Secara Automatik
- Belajar Excel dari Podcast Episode
- 2178 bergabung untuk lembaran kerja hari ini
- soalan melalui YouTube dari Doug mempunyai ini
- keadaan kita mempunyai empat helai di mana masing-masing
- lembaran adalah wilayah dengan data penjualan dan
- bilangan rekod berubah setiap bulan dan
- sekarang Doug cuba menggunakan formula
- tetapi apabila bilangan baris berubah itu
- menjadi mimpi ngeri betul jadi saya berkata hei
- Doug bolehkah kita menggunakan pertanyaan kuasa jika ada
- Excel 2010 atau Excel 2013 adalah percuma
- muat turun dari Microsoft atau sudah dibina
- hingga tahun 2016 dan pejabat 365 mengatakan ya semua
- betul inilah yang kita ada
- empat melaporkan wilayah tengah timur
- wilayah wilayah selatan dan barat
- wilayah dan masing-masing mempunyai perbezaan
- bilangan rekod seperti di sini di Selatan
- Wilayah kami mempunyai 72 catatan di timur
- rantau 193 mencatatkan dan ini akan berlaku
- tukar betul
- setiap kali kita menjalankan laporan ini akan ada
- sebilangan rekod yang berbeza sekarang
- membuat beberapa andaian di sini terlebih dahulu bahawa
- tidak ada lajur yang disebut pusat dan
- maka saya juga akan menjadi jahat
- di sini dan ambil Wilayah Selatan yang saya mahu
- cuba dan kacau saya akan mengambil
- lajur untung memotongnya dan tampalkannya bagaimana
- membalikkannya dan kemudian baiklah jadi kita
- mempunyai satu di mana lajur dibalikkan
- dan yang lain di mana kita akan pergi
- tambah peratus untung kasar lajur tambahan
- jadi ini akan menjadi keuntungan dibahagi dengan
- pendapatan dalam dunia yang ideal ini semua
- berbentuk sama tetapi saya belajar
- baru-baru ini saya mengadakan seminar di
- Carolina Utara jika mereka tidak betul
- seseorang mempunyai keadaan dengan baik yang anda tahu
- pertengahan tahun semuanya berubah
- dan mereka menambah lajur baru atau bergerak
- ruangan di sekitar kami sangat gembira
- lihat bahawa pertanyaan kuasa dapat menangani
- dengan ini baiklah kita akan mengambil
- setiap laporan ini dan membuatnya
- format jadual rasmi seperti jadual
- itu teh kawalan atau anda boleh menggunakan
- julat nama bagi saya kawalan t adalah
- cara yang lebih senang untuk dilalui dan apa yang mereka lakukan di sini
- adakah mereka memanggil jadual ini sebagai satu yang saya mahu
- ganti nama ini menjadi pusat dan
- kemudian kita pergi ke kawalan Timur T klik OK
- dan ini akan dipanggil Timur sekarang hei
- pada podcast sebelumnya saya menunjukkan bagaimana jika
- ini adalah empat fail berasingan yang kami
- boleh menggunakan pertanyaan kuasa hanya untuk
- menggabungkan fail tetapi tidak berfungsi bila
- mereka empat lembaran kerja yang berasingan atau empat
- dalam buku yang sama sama baiknya kita
- pergi dan kemudian
- seperti kawalan ini-sedikit membosankan
- sediakan ini pertama kali tetapi budak lelaki
- pasti ada yang hebat
- setiap kali anda mesti mengemas kini ini kemudian
- jadi yang akan kita lakukan ialah kita akan pergi
- untuk memilih pusat meja pertama ini
- wilayah dan jika anda berada pada tahun 2010 atau 2013 dan
- pertanyaan kuasa yang dimuat turun yang anda mahukan
- akan mempunyai tab sendiri tetapi dalam 16 in
- Excel 2016 sebenarnya mendapat
- berubah yang merupakan kumpulan kedua di
- pejabat 365 kini semakin berubah
- yang merupakan kumpulan pertama dan jadi kami
- akan mengatakan bahawa mereka akan mencipta ini
- data dari jadual atau jarak yang betul dan
- 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
- mengucapkan soalan itu terima kasih
- kerana singgah nanti kita jumpa lagi
- untuk pelakon bersih lain dari
Muat turun fail
Muat turun fail contoh di sini: Podcast2178.xlsm