To align cells quickly in Excel for Microsoft 365 on Windows, select the cells, press Alt, then H, then A, and then L for left, C for center, or R for right alignment. These are sequential key presses, not keys to hold down together. For vertical alignment, use Alt, H, A, then T for top, M for middle, or B for bottom. The shortcuts change how cell contents sit inside the selected cells; they do not move or rearrange the cells themselves.
Before using a shortcut, select the cells you want to format. You can align one cell, a range, or several nonadjacent cells. If you are on a Mac, use Command+L, Command+E, or Command+R for left, center, or right horizontal alignment; use the Home ribbon for vertical alignment. The instructions below focus on Excel for Microsoft 365 on Windows and note where the Mac approach differs.
What You’ll Need
- A workbook open in the desktop version of Excel for Microsoft 365. The Windows ribbon key sequences below apply to the English-language interface.
- A selected cell or range to format. For multiple areas, hold Ctrl while selecting separate ranges on Windows; on Mac, hold Command while selecting them.
- Optional: the Home tab visible if you prefer clicking the alignment buttons or need to check the result.
You do not need to install anything, enable a setting, or change the workbook before applying cell alignment. If you are using Excel for the web, some shortcuts can be intercepted by your browser or operating system; use the Home tab buttons if a shortcut does not work there.
Step-by-Step
-
Select the cells you want to align. Click a cell to format just that cell. To select a continuous block, click the first cell and drag across the range, or click the first cell, hold Shift, and click the last cell. You can also click the Name Box to the left of the formula bar, type a range such as B2:D12, and press Enter. Confirm that the highlighted selection is the intended one before continuing.
To apply one alignment to several separate areas, select the first range, then hold Ctrl and select each additional range on Windows. Do not include a whole row or column unless you mean to change every cell in it. If the active cell is in a table, selecting only the cells you need can avoid formatting unrelated data.
-
Choose horizontal alignment with the Windows key sequence. Press and release Alt, press and release H to open the Home tab key tips, press and release A for the Alignment group, and then press L, C, or R. Use L to align text to the left edge, C to center it horizontally, or R to align it to the right edge.
Tap each key in order rather than holding Alt and pressing all the letters at once. Excel displays small key-tip labels on the ribbon as you go. If the labels differ from these instructions, follow the displayed labels; keyboard layouts, language settings, or versions can affect key tips. You can also click Home and choose the left, center, or right alignment button in the Alignment group.
-
Choose vertical alignment if needed. With the same cells selected, press Alt, H, A, then T to position contents at the top of the cell, M to place them in the middle, or B to position them at the bottom. These choices matter most when a row is taller than the text, for example when a cell contains wrapped text or the row height has been increased.
Horizontal and vertical alignment are separate settings. A heading can be centered left-to-right and aligned to the top of a tall cell, for instance. Apply one direction, then the other, without changing the selection. On a Mac, use the alignment controls on the Home ribbon for vertical positioning rather than relying on the Windows Alt key sequence.
-
Check the alignment in the worksheet. Look at the selected cells and confirm the contents moved as intended. Left, center, and right alignment change the position across the cell; top, middle, and bottom change the position from top to bottom. If nothing seems to move, the content may already have that alignment, the row may be only as tall as the content, or the selected cell may not be the one you expected.
For a clearer check, click a different cell after applying the format and then click back into the range. This removes some selection highlighting and makes the result easier to see. Avoid judging alignment from the formula bar, which displays the cell value rather than its position inside the grid.
-
Adjust the row height or column width when alignment is hard to see. Alignment does not resize a cell. If a row is too short to show vertical spacing, increase its height by dragging the boundary below the row number, or use Home > Format > Row Height. If text is crowded horizontally, adjust the column boundary or use Home > Wrap Text. Wrap Text may increase row height so multiple lines can be displayed.
For example, if a two-line heading is centered vertically in a row that is just one line high, Excel has little visible room in which to show the vertical change. Increase the row height or wrap the heading, then apply middle alignment again if necessary. Alignment and sizing are related visually, but they are different formatting operations.
-
Use the Mac shortcuts for horizontal alignment. In Excel for Mac, select the target cells and press Command+L for left alignment, Command+E for center alignment, or Command+R for right alignment. These are the Mac equivalents for the common horizontal alignment actions. If a shortcut conflicts with a system setting, does something unexpected, or is unavailable in your version, choose the matching button from Home > Alignment.
For vertical positioning on Mac, select the cells and use the top, middle, or bottom alignment buttons on the Home tab. Excel for the web also has alignment buttons on Home; if a keyboard sequence is intercepted, use those buttons instead. The ribbon provides a dependable alternative across platforms.
-
Use Format Cells for more detailed alignment settings. Select the cells and press Ctrl+1 on Windows to open the Format Cells dialog, then select the Alignment tab. There you can set horizontal and vertical alignment and review options such as text control and text orientation. Click OK to apply changes. On a Mac, use Format Cells from the Format menu or the available cell-formatting dialog; shortcut behavior can vary by keyboard and Excel version.
This dialog is useful when you need a setting beyond the basic left, center, right, top, middle, and bottom choices. It can also help you inspect a cell whose alignment seems unusual. Changing settings in the dialog affects the selected cells, so check the selection before clicking OK.
Common Mistakes
-
Holding the key-tip letters together. Alt, H, A, and the final letter are a sequence. Press and release each key. Holding Alt while typing the letters can trigger a different action or fail to open the intended ribbon command.
-
Formatting the wrong selection. A shortcut applies to every selected cell, including hidden rows within a range in many ordinary selections. Check the highlighted cells first, especially after using Ctrl to select separate areas or after selecting an entire row or column.
-
Expecting alignment to change cell size. Left, center, right, top, middle, and bottom only position contents within existing cells. They do not widen columns, increase row height, or add line breaks. Adjust dimensions or use Wrap Text if the content is clipped.
-
Confusing horizontal and vertical alignment. Center alignment places contents midway between the left and right edges. Middle alignment places them midway between the top and bottom edges. A cell can have one, both, or neither setting changed independently.
-
Assuming numbers and text will look identical. Excel commonly aligns numbers to the right and text to the left by default. A shortcut overrides that default for the selected cells, but the displayed result may still be hard to judge if the cells are narrow or adjacent values create visual clutter.
-
Using a Windows key sequence on a Mac. The Alt-based ribbon key tips in this guide are for Windows. On Mac, use Command+L/E/R for horizontal alignment or click the Home ribbon buttons. Windows and Mac shortcuts are not interchangeable.
Tips
-
Use the ribbon as a visual reference. On Windows, select a cell and open Home. The Alignment group contains familiar icons for horizontal and vertical alignment. Hover over a button to see its name, or use the buttons when you are unsure which key tip applies.
-
Apply alignment consistently to headings. Select the heading cells together and apply the same horizontal and vertical settings in one action. Consistent formatting makes a table easier to scan. Avoid centering every data column automatically; text labels are often easier to read when left-aligned, while short headings or figures may benefit from a different choice.
-
Combine alignment with wrapping thoughtfully. Wrap Text is useful for long labels, but it can make rows uneven if only some cells wrap. After wrapping, review the full row and adjust its height if needed. Do not use repeated spaces to imitate alignment; the display can change when column widths or fonts change.
-
Use the Format Cells dialog to inspect inherited formatting. If one cell behaves differently from neighboring cells, open Ctrl+1 on Windows and check the Alignment tab. The cell may have a text orientation, indentation, or text-control option that changes its appearance. You can set the desired values there rather than repeatedly trying shortcuts.
-
Remember that formatting can be copied. Once you have a correctly formatted cell, you can use Format Painter on the Home tab to apply its formatting to another area. Review the destination afterward, because Format Painter may copy more than alignment, including number formats, borders, and fills.
Troubleshooting
-
The shortcut does nothing: On Windows, press Alt and watch for key-tip letters, then continue one key at a time. Make sure Excel has focus rather than another window or an active edit in a cell. If you are editing a value, press Esc to cancel the edit or Enter to finish it, select the cells again, and retry. In Excel for the web, use the Home ribbon buttons if the browser captures a key.
-
The wrong command runs: Check that you began with Alt and followed the key-tip labels on screen. Do not use the Windows sequence on Mac. If your Excel interface uses a different language or shows different letters, use the labels Excel displays or click the alignment button directly.
-
The cell appears unchanged: It may already have the selected alignment. To make a vertical change visible, increase row height. To make horizontal alignment easier to judge, widen the column or temporarily enter a longer sample value in a spare cell. Do not overwrite important data just to test formatting.
-
Text is cut off or overlaps visually: Alignment cannot make a narrow column wide enough for long content. Widen the column, enable Home > Wrap Text, or choose a suitable text-control option in Format Cells. If adjacent cells contain values, text may not visually overflow into them, even when the cell’s alignment is left or right.
-
Only some cells change: The selected range may not cover all the cells you intended, or some areas may be on a protected sheet. Check the selection and whether the worksheet is protected. If protection prevents formatting, ask the workbook owner or use Review > Unprotect Sheet if you have permission and the required password.
-
Formatting returns after reopening or copying data: A table style, pasted formatting, or a workbook template may be applying other visual rules. Reapply alignment to the intended range, inspect the source formatting, and check whether new data is being pasted with its own formatting. When pasting, choose an appropriate Paste option rather than assuming values alone were copied.
Frequently Asked Questions
What is the shortcut to center cells in Excel on Windows?
Select the cells, then press Alt, H, A, C in sequence. This sets horizontal center alignment. To center contents vertically as well, use Alt, H, A, M with the same selection.
Can I align cells without using the mouse?
Yes. On Windows, use the Alt key-tip sequences for horizontal or vertical alignment. You can also select a range through the Name Box. On Mac, use Command+L, Command+E, or Command+R for horizontal alignment and the Home ribbon for vertical alignment.
How do I align text to the middle of a cell?
Middle usually means vertical alignment: on Windows, select the cells and press Alt, H, A, M. If you mean the center between the left and right edges, use Alt, H, A, C instead. Apply both if you want the content centered in both directions.
Will alignment affect every worksheet in the workbook?
No. Alignment applies to the selected cells on the active worksheet. If you have grouped multiple worksheet tabs, formatting can apply to corresponding selected cells on each grouped sheet, so check whether sheet tabs are grouped before using the shortcut.
Why does center alignment seem to have no effect?
The cell may already be centered, or its width may make the change subtle. Check the alignment buttons on Home or inspect Format Cells > Alignment. A longer value or a wider column can make the horizontal position easier to see.
Do the same shortcuts work in Excel for the web?
Some keyboard commands may work, but browser and operating-system shortcuts can interfere. The reliable fallback is to select the cells and click the alignment options on the Home tab. The Windows ribbon key-tip sequence is intended for the desktop app.
Related
- Excel Yellow Color Code: RGB, Hex, and Theme Values
- ISBLANK in Excel: How It Works and When to Use It
- Excel Forecasting: How to Predict Future Values
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Subtotal Multiple Rows in Excel by GroupTo subtotal multiple rows in Excel by category, sort your data by that category, select a cell in…
- How to Wrap Text in Google Sheets: Settings and TipsTo wrap text in Google Sheets in a web browser, select the cell or range, then choose Format…
- Excel: Find Names in Two WorksheetsTo find names from one worksheet in another, enter a check formula beside the list you want to…
- How to Edit a PivotTable in ExcelTo edit a PivotTable in Excel for Microsoft 365 on Windows, click any cell inside it, then use…
- How to Add Consecutive Page Numbers in Microsoft WordTo add consecutive page numbers in Word, choose Insert > Page Number, select where the numbers should appear,…
- Excel Conditional Formatting for Values Less Than a CellTo highlight Excel values that are less than a value in another cell, select the cells to format,…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.