メインコンテンツへスキップ

列と行を単一の列に転置/変換する方法は?

Excelワークシートを使用すると、この問題が発生することがあります。ある範囲のデータをXNUMXつの列に変換または転置するにはどうすればよいでしょうか。 (次のスクリーンショットを参照してください:)ここで、この問題を解決するためのXNUMXつの簡単なトリックを紹介します。

式を使用して、列と行をXNUMXつの列に転置/変換します

VBAコードを使用して列と行を単一の列に転置/変換します

Kutools for Excelを使用して、列と行を単一の列に転置/変換します良いアイデア3


式を使用して、列と行をXNUMXつの列に転置/変換します

次の長い数式は、データの範囲を列にすばやく転置するのに役立ちます。次のようにしてください。

1.まず、データ範囲の範囲名を定義し、変換する範囲データを選択し、右クリックして選択します 名前を定義する コンテキストメニューを形成します。 の中に 新しい名前 ダイアログボックスで、必要な範囲名を入力します。 次に、をクリックします OK。 スクリーンショットを参照してください:

2.範囲名を指定した後、空白のセルをクリックします。この例では、セルE1をクリックして、次の数式を入力します。 =INDEX(MyData,1+INT((ROW(A1)-1)/COLUMNS(MyData)),MOD(ROW(A1)-1+COLUMNS(MyData),COLUMNS(MyData))+1).

Note: MyData は選択したデータの範囲名です。必要に応じて変更できます。

3.次に、エラー情報が表示されるまで、数式をセルまでドラッグします。 範囲内のすべてのデータがXNUMXつの列に置き換えられました。 スクリーンショットを参照してください:


Excelで範囲を列/行/またはその逆にすばやく転置します

場合によっては、セルの範囲をXNUMXつの列または行に転置する必要があります。その逆の場合は、Excelシートで列または行を複数の行および列に変換する必要があります。 それを解決する簡単な方法はありますか? ここに 転置範囲 の機能 Kutools for Excel 上記のすべてのジョブを簡単に処理できます。クリックすると、30 日間の全機能を無料で試用できます。
doc1
 
Kutools for Excel:300を超える便利なExcelアドインがあり、30日以内に制限なしで無料で試すことができます。

VBAコードを使用して列と行を単一の列に転置/変換します

次のVBAコードを使用して、複数の列と行をXNUMXつの列に結合することもできます。

1。 押さえつける Alt + F11 キーを押して アプリケーション向け Microsoft Visual Basic 窓。

2。 クリック インセット > モジュール、次のコードをに貼り付けます モジュール 窓。

Sub ConvertRangeToColumn()
'Updateby20131126
Dim Range1 As Range, Range2 As Range, Rng As Range
Dim rowIndex As Integer
xTitleId = "KutoolsforExcel"
Set Range1 = Application.Selection
Set Range1 = Application.InputBox("Source Ranges:", xTitleId, Range1.Address, Type:=8)
Set Range2 = Application.InputBox("Convert to (single cell):", xTitleId, Type:=8)
rowIndex = 0
Application.ScreenUpdating = False
For Each Rng In Range1.Rows
    Rng.Copy
    Range2.Offset(rowIndex, 0).PasteSpecial Paste:=xlPasteAll, Transpose:=True
    rowIndex = rowIndex + Rng.Columns.Count
Next
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub

3。 押す F5 キーを押してコードを実行すると、変換する範囲を選択するためのダイアログが表示されます。 スクリーンショットを参照してください:

4。 次に、をクリックします Ok、および結果を出力する単一セルを選択するための別のダイアログが表示されます。スクリーンショットを参照してください。

5.そしてクリックします Okの場合、範囲のセルの内容が列のリストに変換されます。スクリーンショットを参照してください。

doc-convert-range-to-column11


Kutools for Excelを使用して、列と行を単一の列に転置/変換します

数式が長すぎて覚えられない可能性があり、VBAコードにはいくつかの制限があります。この状況では、心配しないでください。ここでは、より簡単で多機能なツールを紹介します-Kutools for Excelそのと Transform Range ユーティリティ、そしてあなたはこの問題を素早くそして便利に解決することができます。

Kutools for Excel, 以上で 300 便利な機能は、あなたの仕事をより簡単にします。 

無料インストール Kutools for Excel、以下のようにしてください:

1.移調する範囲を選択します。

2。 クリック クツール > Transform Range、スクリーンショットを参照してください:

docは範囲を列12に変換します

3。 の中に Transform Range ダイアログボックスで Range to single column オプション、スクリーンショットを参照してください:

docは範囲を列13に変換します

4。 次に、をクリックします OK、およびポップアウトボックスからの結果を配置するセルを指定します。

docは範囲を列14に変換します

5。 クリック OK、および複数の列と行のデータがXNUMXつの列に置き換えられました。
docは範囲を列15に変換します

列を固定行の範囲に変換する場合は、 Transform Range 迅速に処理する機能。
docは範囲を列16に変換します


クロステーブルをKutoolsforExcelでリストテーブルに転置

以下のスクリーンショットに示すように、クロステーブルをリストテーブルに変換する必要がある場合は、データをXNUMXつずつ再入力する以外に、次を使用することもできます。 Kutools for Excelさん Transpose Table Dimensions クロステーブルとExcelのリストをすばやく変換するユーティリティ。
docは範囲を列19に変換します

無料インストール Kutools for Excel、以下のようにしてください:

1.リストに変換するクロステーブルを選択し、をクリックします クツール > Range > Transpose Table Dimensions.
docは範囲を列18に変換します

2。 で Transpose Table Dimension ダイアログ、チェック Cross table to list オプションオン Transpose type セクションで、新しいフォーマットテーブルを配置するセルを選択します。
docは範囲を列18に変換します

3。 クリック Ok、これでクロステーブルがリストに変換されました。


関連記事:

Excelで行を列に変更するにはどうすればよいですか?

Excelで単一の列を複数の列に転置/変換する方法は?

列と行を単一の行に転置/変換する方法は?

最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!
Comments (58)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
thanks for the tutor, very helpfull
This comment was minimized by the moderator on the site
Wow! This is amazing! My data starts on A2 rather than A1 but when I change that in the formula it's grabbing B2 to start rather than A2. I've tried changing things up but can't seem to get it to work. Can you please LMK what I need to change in the formula? Thanks in advance and appreciate any advise!
This comment was minimized by the moderator on the site
Hello, Graves
Yes, as you said, the formula is not correct when the data starts from A2, in this case, you can apply the following formula:
=OFFSET(mydata,TRUNC((ROW()-ROW($G$1))/COLUMNS(mydata)),MOD(ROW()-ROW($G$1),COLUMNS(mydata)),1,1)

Note: In the above fromula, mydata is the range name of the selected data, G1 is the cell you enter this formula, please change them to your own.
Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Convert table to one column, ignore blank cell and duplicates value. How ?
This comment was minimized by the moderator on the site
After converting the table to a column, using Excel' Remove Duplicate feature to remove the duplicates, then select the column range, use the Delete Blank Rows of Kutools for Excel to remove the blank cells.
This comment was minimized by the moderator on the site
Thank you so much! :)
This comment was minimized by the moderator on the site
the data i am transposing to single column from rows have blanks in it how can i ignore them while transposing
This comment was minimized by the moderator on the site
Hi, sai, you can transpose them to single column firstly, then remove the blank rows. How to remove blank rows, you can go to this article, it introduces 4 ways to remove blank rows, there must be one method can help you. https://www.extendoffice.com/documents/excel/525-excel-remove-blank-rows.html
This comment was minimized by the moderator on the site
thanks a lot; beautifull :-)
This comment was minimized by the moderator on the site
Worked like a charm. Thanks a lot
This comment was minimized by the moderator on the site
thanxs you have reduced my too much time....wonderful
This comment was minimized by the moderator on the site
What if the table you start with has a range of values that is different for each row? Example: Say the table doesn't have FF, KK and LL, how do you make a single column from that table without doing them above example by hand?
This comment was minimized by the moderator on the site
Just try above methods, if they cannot work, please tell me and upload your data as a picture to give some details
This comment was minimized by the moderator on the site
THAT'S AMAZING! THANKYOU
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations