Excel: Modifying Columns, Rows, and Cells (2024)

Lesson 6: Modifying Columns, Rows, and Cells

/en/excel/cell-basics/content/

Introduction

By default, every row and column of a new workbook is set to the same height and width. Excel allows you to modify column width and row height in different ways, including wrapping text and merging cells.

Optional: Download our practice workbook.

Watch the video below to learn more about modifying columns, rows, and cells.

To modify column width:

In our example below, column C is too narrow to display all of the content in these cells. We can make all of this content visible by changing the width of column C.

  1. Position the mouse over the column line in the column heading so the cursor becomes a double arrow.

    Excel: Modifying Columns, Rows, and Cells (1)

  2. Click and drag the mouse to increase or decrease the column width.

    Excel: Modifying Columns, Rows, and Cells (2)

  3. Release the mouse. The column width will be changed.

    Excel: Modifying Columns, Rows, and Cells (3)

With numerical data, the cell will display pound signs (#######) if the column is too narrow. Simply increase the column width to make the data visible.

To AutoFit column width:

The AutoFit feature will allow you to set a column's width to fit its content automatically.

  1. Position the mouse over the column line in the column heading so the cursor becomes a double arrow.

    Excel: Modifying Columns, Rows, and Cells (4)

  2. Double-click the mouse. The column width will be changed automatically to fit the content.

    Excel: Modifying Columns, Rows, and Cells (5)

You can also AutoFit the width for several columns at the same time. Simply select the columns you want to AutoFit, then select the AutoFit Column Width command from the Format drop-down menu on the Home tab. This method can also be used for row height.

Excel: Modifying Columns, Rows, and Cells (6)

To modify row height:

  1. Position the cursor over the row line so the cursor becomes a double arrow.

    Excel: Modifying Columns, Rows, and Cells (7)

  2. Click and drag the mouse to increase or decrease the row height.

    Excel: Modifying Columns, Rows, and Cells (8)

  3. Release the mouse. The height of the selected row will be changed.

    Excel: Modifying Columns, Rows, and Cells (9)

To modify all rows or columns:

Instead of resizing rows and columns individually, you can modify the height and width of every row and column at the same time. This method allows you to set a uniform size for every row and column in your worksheet. In our example, we will set a uniform row height.

  1. Locate and click the Select All button just below the name box to select every cell in the worksheet.

    Excel: Modifying Columns, Rows, and Cells (10)

  2. Position the mouse over a row line so the cursor becomes a double arrow.
  3. Click and drag the mouse to increase or decrease the row height, then release the mouse when you are satisfied. The row height will be changed for the entire worksheet.

    Excel: Modifying Columns, Rows, and Cells (11)

Inserting, deleting, moving, and hiding

After you've been working with a workbook for a while, you may find that you want to insert new columns or rows, delete certain rows or columns, move them to a different location in the worksheet, or even hide them.

To insert rows:

  1. Select the row heading below where you want the new row to appear. In this example, we want to insert a row between rows 4 and 5, so we'll select row 5.

    Excel: Modifying Columns, Rows, and Cells (12)

  2. Click the Insert command on the Home tab.

    Excel: Modifying Columns, Rows, and Cells (13)

  3. The new row will appear above the selected row.

    Excel: Modifying Columns, Rows, and Cells (14)

When inserting new rows, columns, or cells, you will see a paintbrush icon next to the inserted cells. This button allows you to choose how Excel formats these cells. By default, Excel formats inserted rows with the same formatting as the cells in the row above. To access additional options, hover your mouse over the icon, then click the drop-down arrow.

Excel: Modifying Columns, Rows, and Cells (15)

To insert columns:

  1. Select the column heading to the right of where you want the new column to appear. For example, if you want to insert a column between columns D and E, select column E.

    Excel: Modifying Columns, Rows, and Cells (16)

  2. Click the Insert command on the Home tab.

    Excel: Modifying Columns, Rows, and Cells (17)

  3. The new column will appear to the left of the selected column.

    Excel: Modifying Columns, Rows, and Cells (18)

When inserting rows and columns, make sure to select the entire row or column by clicking the heading. If you select only a cell in the row or column, the Insert command will only insert a new cell.

To delete a row or column:

It's easy to delete a row or column that you no longer need. In our example we'll delete a row, but you can delete a column the same way.

  1. Select the row you want to delete. In our example, we'll select row 9.

    Excel: Modifying Columns, Rows, and Cells (19)

  2. Click the Delete command on the Home tab.

    Excel: Modifying Columns, Rows, and Cells (20)

  3. The selected row will be deleted, and those around it will shift. In our example, row 10 has moved up, so it's now row 9.

    Excel: Modifying Columns, Rows, and Cells (21)

It's important to understand the difference between deleting a row or column and simply clearing its contents. If you want to remove the content from a row or column without causing others to shift, right-click a heading, then select Clear Contents from the drop-down menu.

Excel: Modifying Columns, Rows, and Cells (22)

To move a row or column:

Sometimes you may want to move a column or row to rearrange the content of your worksheet. In our example we'll move a column, but you can move a row in the same way.

  1. Select the desired column heading for the column you want to move.

    Excel: Modifying Columns, Rows, and Cells (23)

  2. Click the Cut command on the Home tab, or press Ctrl+X on your keyboard.

    Excel: Modifying Columns, Rows, and Cells (24)

  3. Select the column heading to the right of where you want to move the column. For example, if you want to move a column between columns E and F, select column F.

    Excel: Modifying Columns, Rows, and Cells (25)

  4. Click the Insert command on the Home tab, then select Insert Cut Cells from the drop-down menu.

    Excel: Modifying Columns, Rows, and Cells (26)

  5. The column will be moved to the selected location, and the columns around it will shift.

    Excel: Modifying Columns, Rows, and Cells (27)

You can also access the Cut and Insert commands by right-clicking the mouse and selecting the desired commands from the drop-down menu.

Excel: Modifying Columns, Rows, and Cells (28)

To hide and unhide a row or column:

At times, you may want to compare certain rows or columns without changing the organization of your worksheet. To do this, Excel allows you to hide rows and columns as needed. In our example we'll hide a few columns, but you can hide rows in the same way.

  1. Select the columns you want to hide, right-click the mouse, then select Hide from the formatting menu. In our example, we'll hide columns C, D, and E.

    Excel: Modifying Columns, Rows, and Cells (29)

  2. The columns will be hidden. The green column line indicates the location of the hidden columns.

    Excel: Modifying Columns, Rows, and Cells (30)

  3. To unhide the columns, select the columns on both sides of the hidden columns. In our example, we'll select columns B and F. Then right-click the mouse and select Unhide from the formatting menu.

    Excel: Modifying Columns, Rows, and Cells (31)

  4. The hidden columns will reappear.

    Excel: Modifying Columns, Rows, and Cells (32)

Wrapping text and merging cells

Whenever you have too much cell content to be displayed in a single cell, you may decide to wrap the text or merge the cell rather than resize a column. Wrapping the text will automatically modify a cell's row height, allowing cell contents to be displayed on multiple lines. Merging allows you to combine a cell with adjacent empty cells to create one large cell.

To wrap text in cells:

  1. Select the cells you want to wrap. In this example, we'll select the cells in column C.
  2. Click the Wrap Text command on the Home tab.

    Excel: Modifying Columns, Rows, and Cells (33)

  3. The text in the selected cells will be wrapped.

    Excel: Modifying Columns, Rows, and Cells (34)

Click the Wrap Text command again to unwrap the text.

To merge cells using the Merge & Center command:

  1. Select the cell range you want to merge. In our example, we'll select A1:F1.
  2. Click the Merge & Center command on the Home tab. In our example, we'll select the cell range A1:F1.

    Excel: Modifying Columns, Rows, and Cells (35)

  3. The selected cells will be merged, and the text will be centered.

    Excel: Modifying Columns, Rows, and Cells (36)

To access additional merge options:

If you click the drop-down arrow next to the Merge & Center command on the Home tab, the Merge drop-down menu will appear.

Excel: Modifying Columns, Rows, and Cells (37)

From here, you can choose to:

  • Merge & Center: This merges the selected cells into one cell and centers the text.
  • Merge Across: This merges the selected cells into larger cells while keeping each row separate.
  • Merge Cells: This merges the selected cells into one cell but does not center the text.
  • Unmerge Cells: This unmerges selected cells.

Be careful when using this feature. If you merge multiple cells that all contain data, Excel will keep only the contents of the upper-left cell and discard everything else.

Centering across selection

Merging can be useful for organizing your data, but it can also create problems later on. For example, it can be difficult to move, copy, and paste content from merged cells. A good alternative to merging is to Center Across Selection, which creates a similar effect without actually combining cells.

Watch the video below to learn why you should use Center Across Selection instead of merging cells.

To use Center Across Selection:

  1. Select the desired cell range. In our example, we'll select A1:F1. Note: If you already merged these cells, you should unmerge them before continuing to step 2.
  2. Click the small arrow in the lower-right corner of the Alignment group on the Home tab.

    Excel: Modifying Columns, Rows, and Cells (38)

  3. A dialog box will appear. Locate and select the Horizontal drop-down menu, select Center Across Selection, then click OK.

    Excel: Modifying Columns, Rows, and Cells (39)

  4. The content will be centered across the selected cell range. As you can see, this creates the same visual result as merging and centering, but it preserves each cell within A1:F1.

    Excel: Modifying Columns, Rows, and Cells (40)

Challenge!

  1. Open our practice workbook.
  2. Autofit Column Width for the entire workbook.
  3. Modify the row height for rows 3 to 14 to 22.5 (30 pixels).
  4. Delete row 10.
  5. Insert a column to the left of column C. Type SECONDARY CONTACT in cell C2.
  6. Make sure cell C2 is still selected and choose Wrap Text.
  7. Merge and Center cells A1:F1.
  8. Hide the Billing Address and Phone columns.
  9. When you're finished, your workbook should look something like this:

    Excel: Modifying Columns, Rows, and Cells (41)

Excel: Modifying Columns, Rows, and Cells (43)

Previous: Cell Basics

Next:Formatting Cells

Excel: Modifying Columns, Rows, and Cells (44)

/en/excel/formatting-cells/content/

Excel: Modifying Columns, Rows, and Cells (2024)

FAQs

What is the shortcut to adjust rows and columns in Excel? ›

Press one of the following keyboard shortcuts: To AutoFit column width: Alt + H, then O, and then I. To AutoFit row height: Alt + H, then O, and then A.

How do you edit multiple cells at once? ›

You can drag an area with your mouse, hold down SHIFT and click in two cells to select all the ones between them, or hold down CTRL and click to add individual cells. Then type in your selected text. Finally, hit CTRL+ENTER (instead of enter) and it'll be entered into all the selected cells.

What shortcut key is used to modify a cell? ›

By default, we can use the “F2” shortcut key for editing in the cell.

How do you modify all rows or columns at the same time? ›

To modify all rows or columns:
  1. Locate and click the Select All button just below the name box to select every cell in the worksheet.
  2. Position the mouse over a row line so the cursor becomes a double arrow.
  3. Click and drag the mouse to increase or decrease the row height, then release the mouse when you are satisfied.

How do you automatically resize all columns and rows to fit the data? ›

Automatically resize all columns and rows to fit the data
  1. Select the Select All button. at the top of the worksheet, to select all columns and rows.
  2. Double-click a boundary. All columns or rows resize to fit the data.

How do I make all rows and columns the same size? ›

Make multiple columns or rows the same size
  1. Select the columns or rows you want to make the same size. You can press CTRL while you select to choose several sections that are not next to each other.
  2. On the Layout tab, in the Cell Size group, click Distribute Columns. or Distribute Rows .

How do you edit data in a column? ›

To change the data type of a column in a table, use the following syntax:
  1. SQL Server / MS Access: ALTER TABLE table_name. ALTER COLUMN column_name datatype;
  2. My SQL / Oracle (prior version 10G): ALTER TABLE table_name. MODIFY COLUMN column_name datatype;
  3. Oracle 10G and later: ALTER TABLE table_name.

How do you customize cells in Excel? ›

Create a custom cell style
  1. On the Home tab, in the Styles group, click Cell Styles. ...
  2. Click New Cell Style.
  3. In the Style name box, type an appropriate name for the new cell style.
  4. Click Format.
  5. On the various tabs in the Format Cells dialog box, select the formatting that you want, and then click OK.

Which command is used to modify a column? ›

The SQL ALTER TABLE command is used to add, delete or modify columns in an existing table.

What is Ctrl Shift+ in Excel? ›

Press Ctrl + Shift + $ to apply Currency format, Ctrl + Shift + ~ to apply General number format, Ctrl + Shift % to apply Percentage format, Ctrl + Shift + # to apply Date format, Ctrl + Shift + @ to apply Time format, Ctrl + Shift + ! to apply Number format with two decimal places and thousands separator, and Ctrl + ...

What does Ctrl Alt F9 do in Excel? ›

Ctrl+Alt+F9 calculates all worksheets in all open workbooks, regardless of whether they have changed since the last calculation. Ctrl+Alt+Shift+F9 rechecks dependent formulas, and then calculates all cells in all open workbooks, including cells not marked as needing to be calculated.

What is Ctrl G in Excel? ›

In Microsoft Excel and most other spreadsheet programs, pressing Ctrl + G opens the Go To window that lets you focus a specific reference (cell). For example, you could press Ctrl + G , type n8, and press Enter to move to the N8 cell.

How do you manipulate multiple cells in Excel? ›

All you need to do is create a selection set of the cells you want to edit. (Selection sets are created by clicking on a single cell then, as you hold down the Ctrl key, clicking on other cells you want included in the set.) Type the formula you want to appear in each cell in the set, then press Ctrl+Enter.

How do you bulk edit text in Excel? ›

Replace text or numbers with the Find & Replace
  1. Press Ctrl+H or go to Home > Find & Select > Replace.
  2. In Find what, type the text or numbers you want to find.
  3. You can further define your search: ...
  4. In the Replace with box, enter the text or numbers you want to use to replace the search text.
  5. Select Replace or Replace All.

How do you apply the same change to multiple cells in Excel? ›

Insert the same data into multiple cells using Ctrl+Enter
  1. Select all the blank cells in a column.
  2. Press F2 to edit the last selected cell and type some data: it can be text, a number, or a formula (e.g. "_unknown_")
  3. Press Ctrl+Enter instead of Enter. All the selected cells will be filled with the data that you typed.
Oct 21, 2022

What is Ctrl M in Excel? ›

In Microsoft Word and other word processor programs, pressing Ctrl + M indents the paragraph. If you press this keyboard shortcut more than once, it continues to indent further.

What is the F9 key used for? ›

F11: Saves the file in the active window. F9: Sends the e-mail in the active window. F10: Starts the spell checking program in the active document, if the document's program has this feature.

What does F7 do in Excel? ›

  • F7 alone: Opens the Spelling dialog box to check spelling in the active worksheet or selected range.
  • Ctrl+F7: performs the Move command on the workbook window when it is not maximized. Use the arrow keys to move the window, and when finished press Enter, or Esc to cancel.
Jul 6, 2022

How do I apply changes to all cells in a column? ›

The easiest way to apply a formula to the entire column in all adjacent cells is by double-clicking the fill handle by selecting the formula cell. In this example, we need to select the cell F2 and double click on the bottom right corner. Excel applies the same formula to all the adjacent cells in the entire column F.

How do I update multiple rows in Excel with the same value? ›

Choose your update method
  1. Update 1 row at a time. by clicking on 1 of the cells within that row and clicking your desired update method.
  2. Update multiple rows at a time. by selecting a cell within those rows and clicking your desired update method.
  3. Update all rows at once.

How do you apply the same functions to all rows and columns of a matrix? ›

One of the most famous and most used features of R is the *apply() family of functions, such as apply() , tapply() , and lapply() . Here, we'll look at apply() , which instructs R to call a user-specified function on each of the rows or each of the columns of a matrix.

How do I change the scaling option so all columns? ›

Change the Scaling (Fit All Rows/Columns in One Page)
  1. Click the File tab.
  2. Click on Print (or use the keyboard shortcut – Control + P)
  3. In the Print window, click on the Scaling option (it's the last option on the left)
  4. Click on any one of the options: Fit Sheet on One Page. Fir All Columns on One Page.

How do I resize all rows in Excel? ›

Select all the rows by clicking and dragging on the row headers (or select the cells in a column for all the rows for which you want to change the height) Click the Home tab. in the Cells group, click on the Format option. In the dropdown, click on the Row Height option.

What is the shortcut to make all cells the same size in Excel? ›

First, select the cells you want to resize. Then, press and hold the "Ctrl" key on your keyboard. While you're holding "Ctrl," press the "=" key. This shortcut will automatically resize all of the selected cells to be the same size.

Is it possible to modify datatype of a column? ›

You can modify the data type of a column in SQL Server by using SQL Server Management Studio or Transact-SQL. Modifying the data type of a column that already contains data can result in the permanent loss of data when the existing data is converted to the new type.

Can you edit a data table in Excel? ›

Because the data table values are in an array, you cannot edit or clear individual cells. If you try to change one cell, you will see an error message - "Cannot change part of a data table." If you want to remove the entire table, or the resulting values, follow the steps below.

Which command is used to modify the rows? ›

The SQL UPDATE query is used to modify the existing records in a table. We can use the WHERE clause with the UPDATE query to update the selected rows, otherwise all the rows would be affected.

What is column manipulation? ›

Column Manipulation is a type of Data Transformation in which a new column is populated with values from an existing column, which meets certain criteria. The criteria can be an expression, which is created as part of the Data Transformation step.

Which command is used to modify data? ›

Answer: The UPDATE command is used to modify the records of a table.

What is Shift F11 used for? ›

Shift+F11 keys minimizes an ICA session window for fixed windows and published desktops. Some applications might use this key combination to perform specific functions requiring you to change this key mapping.

What is Ctrl Shift L in Excel? ›

For example, to press the shortcut Ctrl+Shift+L to Toggle Filters, you will: Press & hold Ctrl, then press & hold Shift, then press L. Then release all keys.

What does Ctrl Alt Shift H do? ›

This section lists and describes the keyboard shortcuts that include the Ctrl+Alt+Shift keys.
...
Ctrl+Alt+Shift
ShortcutFunctionUse this shortcut to...
Ctrl+Alt+Shift+HPop up HectorOpen the Highlighting levelpopup.
5 more rows
Jul 21, 2022

What is SHIFT F8 used for? ›

So, SHIFT + F8 allows us to select non-adjacent cells. As in our previous example, make sure you see the text in the status bar only this time it should read “Add or Remove Selection”. And how does it work with the SUM function?

What is F1 F2 F3 F4 f5 F6 F7 F8 F9 F10 f11 F12? ›

The function keys or F-keys on a computer keyboard, labeled F1 through F12, are keys that have a special function defined by the operating system, or by a currently running program. They may be combined with the Alt or Ctrl keys.

What does SHIFT F2 do in Excel? ›

Keyboard shortcuts for formatting cells
To do thisPress
Insert a note. Open and edit a cell note.Shift+F2 Shift+F2
Insert a threaded comment. Open and reply to a threaded comment.Ctrl+Shift+F2 Ctrl+Shift+F2
Open the Insert dialog box to insert blank cells.Ctrl+Shift+Plus sign (+)
33 more rows

What is Ctrl +H? ›

CTRL+H or Replace button opens the Find tab on the Find and Replace dialog in Excel 2016. Excel 2016.

What is Ctrl J in Excel? ›

On the keyboard, press Ctrl + J to enter the line break character -- NOTE: Nothing will appear in the Find What box. Press the Tab key on the keyboard, to move to the Replace With box. Type a space character.

What is Ctrl R in Excel? ›

In Microsoft Excel and other spreadsheet programs, pressing Ctrl + R fills the row cell(s) to the right with the contents of the selected cell. To fill more than one cell, select the source cell and press Ctrl + Shift + Right arrow to select additional ones.

How do you modify a column? ›

To modify column width:
  1. Position the mouse over the column line in the column heading so the cursor becomes a double arrow.
  2. Click and drag the mouse to increase or decrease the column width.
  3. Release the mouse. The column width will be changed.

How do you modify columns in a table? ›

To change the data type of a column in a table, use the following syntax:
  1. SQL Server / MS Access: ALTER TABLE table_name. ALTER COLUMN column_name datatype;
  2. My SQL / Oracle (prior version 10G): ALTER TABLE table_name. MODIFY COLUMN column_name datatype;
  3. Oracle 10G and later: ALTER TABLE table_name.

How do you modify a column in a data frame? ›

  1. Rename columns. Use rename() method of the DataFrame to change the name of a column. ...
  2. Add columns. You can add a column to DataFrame object by assigning an array-like object (list, ndarray, Series) to a new column using the [ ] operator. ...
  3. Delete columns. In [7]: ...
  4. Insert/Rearrange columns. ...
  5. Replace column contents.

What is the quickest way to adjust columns? ›

Left-click the mouse button in the header between the columns or rows that you selected and drag the mouse to the left and right for columns and up and down for the rows to adjust the size of all of the selected columns at once. That's it.

How can we modify existing data in a table? ›

The UPDATE command in SQL is used to modify or change the existing records in a table. If we want to update a particular value, we use the WHERE clause along with the UPDATE clause. If you do not use the WHERE clause, all the rows will be affected.

How do you modify data in a table? ›

To modify table data through a view
  1. In Object Explorer, expand the database that contains the view and then expand Views.
  2. Right-click the view and select Edit Top 200 Rows.
  3. You may need to modify the SELECT statement in the SQL pane to return the rows to be modified.
Nov 18, 2022

Can you modify the structure of an existing table? ›

The SQL ALTER TABLE command is used to change the structure of an existing table. It helps to add or delete columns, create or destroy indexes, change the type of existing columns, or rename columns or the table itself. It can also be used to change the comment for the table and type of the table.

Can we modify data inside a data frame? ›

Using Python replace() method, we can update or change the value of any string within a data frame. We need not provide the index or label values to it. As seen above, we have replaced the word “Siri” with “Code” within the dataframe.

Can we modify table columns after it is created if so how do we do it? ›

ALTER TABLE table_name ALTER COLUMN column_name TYPE data_type; Alters the table by changing the datatype of column. ALTER TABLE table_name RENAME TO new_table_name; Changes the name of a table in the currently connected to database.

How we can modify column widths and row heights? ›

Select a column or a range of columns. On the Home tab, select Format > Column Width (or Column Height). Type the column width and select OK.

Top Articles
Latest Posts
Article information

Author: Laurine Ryan

Last Updated:

Views: 6070

Rating: 4.7 / 5 (77 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Laurine Ryan

Birthday: 1994-12-23

Address: Suite 751 871 Lissette Throughway, West Kittie, NH 41603

Phone: +2366831109631

Job: Sales Producer

Hobby: Creative writing, Motor sports, Do it yourself, Skateboarding, Coffee roasting, Calligraphy, Stand-up comedy

Introduction: My name is Laurine Ryan, I am a adorable, fair, graceful, spotless, gorgeous, homely, cooperative person who loves writing and wants to share my knowledge and understanding with you.