How to Find the Indent Level in Excel Cells and Check It

How-to basics · Updated November 20, 2026

To find a cell’s exact indent level in Excel for Microsoft 365 on Windows, select the cell, open Home > Alignment group’s dialog box launcher, and read the number in the Indent box on the Alignment tab. The number is the cell’s alignment indent setting, not a count of spaces in its contents. For a quick visual adjustment, use the Increase Indent and Decrease Indent buttons; to inspect many cells at once, use the optional VBA audit later in this guide.

You do not need an add-in or a special formula to check one cell. If you plan to inspect a large range, save a copy of the workbook before running any macro. The steps below are for desktop Excel; notes explain what differs on Mac and in Excel for the web.

What You’ll Need

  • Excel for Microsoft 365 on Windows for the full dialog and VBA steps.
  • A workbook with the cells you want to inspect. You can use a blank workbook to practise.
  • For the optional range audit, permission to run macros. Save a copy first, because macro actions cannot be reversed with Ctrl+Z.

Step-by-Step

  1. Select the cell you want to check. Click once inside the cell, or use the Name Box to select it by address, such as D8. If you select several cells, Excel may not display a single number when their indent settings differ. For the clearest reading, select one cell at a time. If the cell is merged, select the merged cell and check its setting; the top-left cell is the stored cell in a merged area.
  2. Open the Format Cells dialog. On Windows, press Ctrl+1, or right-click the selected cell and choose Format Cells. You can also select the small dialog box launcher at the lower-right of the Home > Alignment group. All three routes open the same formatting dialog.
  3. Choose the Alignment tab. In the Format Cells dialog, select Alignment if another tab is open. Find the Horizontal options and the adjacent Indent box. The value shown is the selected cell’s indent level. A value of 0 means no alignment indent; a value such as 2 means two indent steps are set.
  4. Read the value without changing it. If you only need to identify the level, note the number and choose Cancel to close the dialog without applying changes. Choosing OK also closes it, but use that only if you deliberately changed a setting. If the box is blank or unavailable with multiple cells selected, inspect the cells individually; mixed formatting can prevent one shared value from appearing.
  5. Check the ribbon buttons if you only need a quick comparison. Return to the Home tab and look in Alignment for Increase Indent and Decrease Indent. These buttons change the setting one step at a time. They are useful for adjusting a cell, but they do not show its current numerical level. Do not count clicks based on how far the text looks from the cell edge: column width, font, and alignment affect appearance.
  6. For many cells, prepare a report with VBA (optional). First select the cells to audit and save a copy of the workbook. If the Developer tab is not visible, enable it through File > Options > Customize Ribbon and check Developer. Choose Developer > Visual Basic, then in the Visual Basic Editor choose Insert > Module. Paste the macro below into the module. It adds a worksheet listing each selected cell and its indent level; it does not alter the selected cells.
  7. Run the audit and read its results. Return to the workbook, select the range you want to inspect, and open the Visual Basic Editor again. Click inside the ListIndentLevels procedure and press F5. Excel creates a new worksheet with the source cell address in column A and its indent level in column B. Check that the report includes the cells you intended to select before using it as an audit record. The macro adds a sheet, and macros cannot be undone with Ctrl+Z.
Sub ListIndentLevels()
    Dim sourceRange As Range
    Dim targetCell As Range
    Dim outputSheet As Worksheet
    Dim outputRow As Long

    ' Stop if the current selection is not a cell range.
    If TypeName(Selection) <> "Range" Then Exit Sub
    Set sourceRange = Selection

    ' Add a report sheet to the source workbook.
    Set outputSheet = sourceRange.Worksheet.Parent.Worksheets.Add( _
        After:=sourceRange.Worksheet.Parent.Worksheets( _
        sourceRange.Worksheet.Parent.Worksheets.Count))

    outputSheet.Cells(1, 1).Value = "Cell"
    outputSheet.Cells(1, 2).Value = "Indent level"
    outputRow = 2

    ' Record the address and indent setting for each selected cell.
    For Each targetCell In sourceRange.Cells
        outputSheet.Cells(outputRow, 1).Value = _
            targetCell.Worksheet.Name & "!" & targetCell.Address(False, False)
        outputSheet.Cells(outputRow, 2).Value = targetCell.IndentLevel
        outputRow = outputRow + 1
    Next targetCell
End Sub

In the code block, & is HTML’s representation of the VBA ampersand operator; the actual VBA operator is & when viewed as text, not a worksheet formula. If copying from a rendered page converts the entity to an ampersand, the lines should read targetCell.Worksheet.Name & "!" & targetCell.Address(False, False). The macro uses Excel’s IndentLevel property, which reports the setting rather than estimating it from the text’s position.

On a Mac, press Command+1 to open Format Cells, then check the Alignment tab and Indent field. The ribbon layout may differ slightly by window size. Excel for the web can adjust indentation with its ribbon controls, but it does not provide the same full desktop Format Cells dialog for reliably reading the numeric setting. Open the workbook in desktop Excel for the exact value; VBA is also a desktop Excel option, not a way to run this audit in the browser.

Common Mistakes

  • Confusing indent with spaces. Indent is a cell-formatting property. A cell may also contain literal spaces before its text, but those spaces are part of the cell value and are not counted in the Indent box. The formula bar shows the value, not the cell’s indent setting.
  • Assuming the toolbar reveals the level. Increase Indent and Decrease Indent apply changes; they do not display a number. Clicking Increase Indent repeatedly just to discover a starting level changes the workbook and can make it harder to restore the original formatting.
  • Reading a mixed selection as one setting. A selection can contain cells with different levels. Do not treat a blank or ambiguous Indent box as proof that every cell has level 0. Select individual cells or create a report for the range.
  • Judging by appearance alone. Text may look indented because of leading spaces, a custom number format, a narrow column, or alignment choices. Conversely, a nonzero indent can be subtle in a wide cell. Use the dialog or the VBA property for a dependable answer.
  • Overwriting or misplacing the audit report. The macro creates a new sheet in the source workbook. Confirm the selected range before running it, and save a separate copy first. Do not expect Ctrl+Z to remove a macro-created sheet or reverse macro actions.

Tips

  • Check the Horizontal alignment setting as well as the number. Indent works with horizontal alignment, and the way it appears depends on the alignment choice. A number alone does not explain every visual detail.
  • For one cell, use the dialog and choose Cancel after reading the number. That avoids accidentally changing formatting while you are inspecting it.
  • For a small group, select cells one at a time and record their addresses and levels in a temporary worksheet. For a long list, the VBA report is faster and preserves a cell-by-cell record.
  • If you need to change rather than inspect a level, use the Increase or Decrease Indent button and then reopen Format Cells to confirm the resulting number. This is safer than trying to estimate the level by eye.
  • Keep the audit report alongside a copy of the original workbook if the indentation matters for review or handoff. The report captures the settings at the time you run the macro; later formatting changes will not update it automatically.

Troubleshooting

The Indent box is greyed out. Check that you selected a worksheet cell and that the relevant horizontal alignment allows indentation. Try selecting a single cell, then reopen Format Cells > Alignment. If the workbook or worksheet is protected, some formatting controls may be unavailable; check Review for an unprotect option, and ask the workbook owner before removing protection.

The displayed number does not match how far the text appears to move. The number records indent steps, not a fixed number of pixels or spaces. Font size, column width, alignment, and the displayed value can change the visual result. Confirm the value in the dialog rather than measuring the text against the cell border.

The dialog shows no useful number for a selection. Select one cell and inspect it again. To compare multiple cells accurately, run the macro with only the intended range selected. If you accidentally selected a whole column or sheet, stop before running the code: it will produce one report row for every selected cell and could create a very large report.

The macro does not run. Make sure the code is in a standard module, the cursor is inside the procedure, and macros are permitted by your organization’s security settings. Excel may require you to save the workbook as a macro-enabled .xlsm file to retain the code. If you cannot enable macros, use the Format Cells dialog for each cell instead. Do not lower security settings broadly just to run a one-time audit.

The report lists an unexpected range. The macro audits the active selection at run time, not a range remembered from when you pasted the code. Return to the worksheet, select the right cells, and run it again. Each run creates another worksheet, so remove unwanted report sheets manually only after confirming they contain no needed information.

Frequently Asked Questions

Can I see the indent level without changing the cell?
Yes. Open Format Cells, choose Alignment, read the Indent value, and click Cancel. Avoid using the increase or decrease buttons as a test because they change the cell’s formatting.

What does an indent level of 0 mean?
It means no alignment indent has been applied to the cell. It does not rule out leading spaces stored in the cell’s text, which are separate from formatting.

Can an Excel formula return a cell’s indent level?
There is no standard worksheet function that directly returns a cell’s IndentLevel property. Use Format Cells for individual cells or VBA for a range. A formula that examines the cell’s text will not detect formatting indentation.

Does Excel for the web show the exact indent number?
The web version supports basic indentation controls, but it does not offer the same dependable numeric inspection workflow as desktop Excel’s Format Cells dialog. Open the file in desktop Excel to read the exact level.

Does the VBA audit change my cell formatting?
No. This macro reads each selected cell’s IndentLevel and writes the address and value to a new worksheet. It does modify the workbook by adding that report sheet, so save a copy first; the addition cannot be undone with Ctrl+Z.

Why do two cells at the same level look different?
Indent level is only one part of cell appearance. Alignment, font, column width, and the contents can affect where the text seems to sit. Compare the numeric setting in Format Cells rather than relying only on the visual spacing.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.