To indent in Excel, select a cell or range, open Home, and choose Increase Indent in the Alignment group. Select it again for more space, or choose Decrease Indent to reduce the indentation. These buttons work in Excel for Microsoft 365 and Excel 2024 on Windows and Mac, plus Excel for the web.
For a specific indentation amount, use Format Cells in desktop Excel. To offset an individual line inside a cell, you can insert spaces in Excel for Microsoft 365 or Excel 2024 for Windows, but those spaces become part of the stored text.
The short version
- Quickest method: Select your cells and choose Home > Alignment > Increase Indent.
- Precise amount: In desktop Excel, open Format Cells > Alignment and set the Indent amount.
- Matching cells: Use Format Painter to copy an existing indent together with the cell’s other formatting.
- Individual lines: Typed spaces can offset one line, but they change the cell’s text.
- Remove the indent: Choose Decrease Indent or set Indent to 0.
| Method | Use | Where it applies |
|---|---|---|
| Increase Indent and Decrease Indent | Adjust cell indentation | Microsoft 365 and Excel 2024 on Windows and Mac; Excel for the web |
| Format Cells | Specify an amount | Microsoft 365 and Excel 2024 desktop |
| Ribbon KeyTips | Reach indent buttons with the keyboard | Microsoft 365 and Excel 2024 for Windows; web on Windows |
| Quick Access Toolbar | Keep indent buttons handy | Microsoft 365 and Excel 2024 for Windows |
| Format Painter | Copy existing formatting | Microsoft 365 and Excel 2024 on Windows and Mac |
| Paste Formatting | Copy formatting while keeping cell contents | Microsoft 365 and Excel 2024 desktop |
| Copy Here as Formats Only | Drag formatting to another location | Excel desktop |
| Cell Styles | Reuse an indentation setting | Microsoft 365 and Excel 2024 for Windows |
| Typed spaces | Offset individual lines | Microsoft 365 and Excel 2024 for Windows |
| Formula with leading spaces | Create a separate text result | Microsoft 365 and Excel 2024 on Windows and Mac |
| Custom number format | Display spacing without changing stored text | Microsoft 365 and Excel 2024 for Windows |
| PivotTable compact layout | Indent nested row labels | Microsoft 365 and Excel 2024 for Windows |
| Recorded macro | Repeat an indent action | Microsoft 365 and Excel 2024 on Windows and Mac, with macros permitted |
| VBA | Set a range’s indentation in code | VBA-capable desktop Excel |
| Office Scripts | Indent the selected range with code | Eligible Microsoft 365 users on supported Windows, Mac and web editions |
| Windows voice access | Activate the visible indent button | Windows 11 with voice access running |
| Worksheet protection settings | Allow formatting changes | Microsoft 365 and Excel 2024 for Windows, with authorization |
| Clear Formats | Remove indentation and other formatting | Excel 2024 on Windows and Mac |
Indent cells from the Home ribbon
Select the cell you want to indent, or select a range to adjust several cells together. Keep the cells selected rather than editing their text. Open Home, find the Alignment group, and select Increase Indent. Repeat for more indentation, or select Decrease Indent to reduce it.
For keyboard access in Excel for Microsoft 365 or Excel 2024 for Windows, select the cells and press Alt, then H. Follow the displayed KeyTips for Increase Indent or Decrease Indent. Access keys can depend on your interface language and ribbon layout, so follow what appears on your screen.
For Excel for the web on Windows, start with Alt + Windows logo key, then press H. Follow the displayed ribbon access keys to the indent button.
Set an exact indentation amount
In Excel for Microsoft 365 or Excel 2024 desktop, select your cells, right-click the selection, and choose Format Cells. You can also open that dialog with Ctrl + 1 on Windows or Command + 1 on Mac. Select the Alignment tab.
Under Horizontal, choose Left (Indent), then enter the amount you want in Indent. Select OK to apply it. To remove the indentation later, return to the same setting, enter 0, and select OK.
Copy indentation from another cell
Format Painter copies the source cell’s other formatting along with its indentation. In Excel for Microsoft 365 or Excel 2024 on Windows and Mac, select the indented cell and choose Home > Format Painter. Drag over the destination cells and release.
Pasting formatting also applies the source formatting while keeping the destination’s contents. In those desktop editions, select the indented cell and choose Home > Copy. Select your destination cells, open Home > Paste, and choose Formatting.
In desktop Excel, drag-copying transfers the indent together with other formatting. Select the formatted cells, point at the selection border, hold the right mouse button, drag to the destination, and release. Select Copy Here as Formats Only. On a Mac with a single-button mouse or trackpad, Microsoft describes Control + click for the right-click action.
Add spaces before text or individual lines
For Excel for Microsoft 365 and Excel 2024 on Windows, select the cell and press F2, double-click it, or click its text in the formula bar. Place the insertion point before the text and press Space as needed. These spaces change the stored text rather than the cell’s indentation setting.
To start a separately indented line inside that cell, insert a line break with Alt + Enter, then type spaces before the new line. Press Enter when you finish editing.
In Excel for Microsoft 365 and Excel 2024 on Windows and Mac, you can also create a separate text result with leading spaces. With your original text in A1, enter the following formula in another cell and press Enter.
=REPT(" ",4)&A1The formula places four spaces before the text from A1, and you can change 4 to the number you need. For a fixed prefix of four spaces, you can instead enter =" "&A1. Both formulas produce text containing actual spaces.
Display leading spaces with a custom format
In Excel for Microsoft 365 or Excel 2024 for Windows, a custom number format can display spaces before text without changing the stored text. Select the text cells, press Ctrl + 1, and select Number > Custom. In Type, enter this format and select OK.
General;General;General;" "@The fourth section adds four displayed spaces before text. Alternatively, enter General;General;General;_(@ to reserve leading space the width of an opening parenthesis. Excel for the web cannot create custom number formats, so use its Increase Indent button for cell indentation.
Indent nested labels in a PivotTable
For nested PivotTable row labels in Excel for Microsoft 365 or Excel 2024 for Windows, click inside the PivotTable. Select Design > Report Layout > Show in Compact Form. This indentation setting controls nested row labels rather than arbitrary worksheet text.
Select PivotTable Analyze > Options. In PivotTable Options, select Layout & Format and set When in compact form indent row labels to a value from 0 to 127. Select OK to apply the amount.
Automate indentation with macros or scripts
In Excel for Microsoft 365 or Excel 2024 on Windows and Mac, you can record an indent action when macro execution is permitted. With Developer visible, select the target cells and choose Developer > Record Macro. Enter a Macro name and, optionally, a Shortcut key, then select OK. Apply Increase Indent, then select Developer > Stop Recording.
To run it, open Developer > Macros, select its name, and select Run. You can assign an existing macro a shortcut through Developer > Macros > Options > Shortcut key. Recording cell selections can tie the macro to particular cells.
In VBA-capable desktop Excel, including Microsoft 365 and Excel 2024 on Windows and Mac, you can set a range’s indentation directly. In a VBA macro, use this statement to set A1 through A10 on Sheet1 to level 2.
Worksheets("Sheet1").Range("A1:A10").IndentLevel = 2Run the macro from Developer > Macros. Microsoft’s VBA reference allows values from 0 to 15, with 0 removing indentation. VBA is not available in Excel for the web.
Office Scripts provides another option for eligible Microsoft 365 users in Excel for the web, Excel for Windows version 2210 or later, and Excel for Mac. Personal and Family availability is a preview requiring Microsoft 365 Insider participation, and organizational settings can disable Office Scripts. If you cannot use Office Scripts, apply indentation with the ribbon buttons.
Select the cells, then choose Automate > New Script > Create in Code Editor. The next step replaces the code currently in the editor. Replace that code with the following script, then select Run.
function main(workbook: ExcelScript.Workbook) { workbook.getSelectedRange().getFormat().setIndentLevel(2); }Change 2 to the indentation level you need. Microsoft’s Office Scripts API allows values from 0 to 250, with 0 removing indentation.
Fix blocked formatting or unwanted indentation
If worksheet protection prevents formatting in Excel for Microsoft 365 or Excel 2024 for Windows, you need the sheet owner’s authorization and the password when applicable. Unprotecting the sheet removes its protection. As an authorized owner, select Review > Unprotect Sheet, enter the password if requested, and select OK.
To retain protection while allowing formatting, select Review > Protect Sheet. Under Allow all users of this worksheet to, select Format cells, then select OK. This permits formatting changes; you still need to apply the indent separately.
To reduce an existing indent, select the cells and choose Decrease Indent. In desktop Excel, setting Indent to 0 in Format Cells removes it while preserving other formatting. Typed or formula-generated spaces belong to the text, so check which method created the spacing before adjusting the indentation setting.
Frequently Asked Questions
Can I put the indent buttons on the Quick Access Toolbar?
Yes, in Excel for Microsoft 365 and Excel 2024 for Windows, open Home, right-click Increase Indent, and select Add to Quick Access Toolbar. Repeat for Decrease Indent if you want both controls, then select your cells and use the added buttons.
Can I save indentation as a reusable cell style?
In Excel for Microsoft 365 and Excel 2024 for Windows, select Home > Cell Styles > New Cell Style and enter a Style name. Select Format > Alignment, set Horizontal to Left (Indent), enter an Indent amount, and select OK twice. Applying the style also applies its other included formatting properties. To reuse it, select destination cells and choose your named style under Home > Cell Styles.
Can I indent cells using voice access?
With voice access already running on Windows 11 and Excel’s indent button exposed, select the cells and display the Home ribbon. Say Show numbers, then say the number displayed on Increase Indent. Repeat to increase the indent further.
Does Clear Formats remove indentation?
Yes, in Excel 2024 on Windows and Mac, Clear Formats removes indentation along with other cell formatting. Select the cells, then choose Home > Clear > Clear Formats.