0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【意外と知られていない】ピボットの自動更新

Last updated at Posted at 2022-11-05

今日は意外と知られていない、
ピボットの自動更新についてかく。

みんな、こんな経験したことはないだろうか。
例えば下記のような図1のようなデータがあって、
図2のようなピボットを作ったとしよう。
このとき図1のデータが増えるたびにピボットの範囲を変える必要がある、めんどくさいことになったことはないだろうか。
その解決策をここでは書きたいとおもう。

<図1>
image.png

<図2>
image.png

■具体的な解決方法
  1. まず名前定義というものを利用して、ピボットする範囲をあらかじめ決めておく。

操作としては、「数式」→「名前の定義」より、

image.png

「名前」を好きな名前(画像では「PVT範囲」)
「範囲」をピボットしたいシート名、
「参照範囲」は表範囲を指定する訳だが
画像のように計算式、
を設定する。
image.png

ここで参照範囲に設定した数式を簡単に説明しておく。
image.png

上記で名前定義した後に、
ピボットをつくりたい場所にセルのカーソルを移動し、
「挿入」→「ピボットテーブル」→「テーブルまたは範囲から」を選択する。

image.png

表示されたダイアログ内で
「テーブル/範囲」に先ほど名前定義した「PVT範囲」を
入力してピボット作成する。

image.png

これで、データが増えたとしても
自動的にピボットが範囲を広げてくれる。

一件落着。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?