Formatting Issues

How to Format Only Part of an Excel Cell (Conditional Formatting)

Camila MilosovichCamila Milosovich Oct 28, 2026 868 views

Question details

The user wants to apply conditional formatting to only specific characters or a partial segment of a text value inside an Excel cell.

How to Format Only Part of an Excel Cell with Conditional Formatting
Product
Excel
Device & OS
Windows, Mac
Scenario
Attempting to apply automated styling to highlight only a portion of a cell's text or formula result based on specific conditions.
Observed behavior
Excel's native conditional formatting applies strictly to the entire cell and cannot automatically color or style only part of a text value or formula result.
Before you start

Be aware that standard conditional formatting cannot target specific characters within a cell. You will need to use a VBA macro, which requires saving your workbook as a Macro-Enabled Workbook (.xlsm).

Solution 1Recommended

Use a VBA Macro for Partial Text Formatting

Since built-in conditional formatting affects the whole cell, using a VBA macro is the most effective workaround to identify and format specific characters.

VBA (Visual Basic for Applications) allows you to target specific text strings within a cell using the Characters object. This method enables you to apply custom styling to partial text automatically. Note that this approach requires manual re-triggering or an event handler if the cell contents update dynamically.

1
Open the VBA Editor

Press 'Alt + F11' (on Windows) or 'Option + F11' (on Mac) to launch the VBA Editor in Excel.

2
Create a New Module

Click 'Insert' in the top menu and select 'Module' to open a new blank script window.

3
Write the VBA Code

Enter your VBA script utilizing the '.Characters(Start, Length)' object to target the specific text and apply properties like '.Font.Color' or '.Font.Bold'.

4
Save as Macro-Enabled File

Go to 'File' > 'Save As' and change the file format to 'Excel Macro-Enabled Workbook (*.xlsm)' so your code is preserved.

5
Run the Macro

Return to your worksheet, navigate to the 'Developer' tab, click 'Macros', select your script, and click 'Run' to apply the partial formatting.

Platform Limitations: VBA macros are only supported in desktop versions of Excel for Windows and Mac. They will not function in Excel for the web, iOS, or Android.
Free Microsoft Office alternative

Experience Seamless Spreadsheets with WPS Office

While native conditional formatting limits partial text styling across major spreadsheet apps, WPS Office offers a free, highly compatible alternative to Microsoft Office. Enjoy lightweight installation and a familiar interface for all your data formatting needs.

  1. 1. Download and Install: Get WPS Office for free from the official website and install it quickly on your Windows or Mac device.
  2. 2. Open Your Spreadsheet: Launch WPS Spreadsheets and open your existing Excel workbooks seamlessly without losing any layout data.
  3. 3. Edit and Format: Use the comprehensive formatting tools to edit your data efficiently without worrying about cross-platform compatibility issues.
Free to use with a fast and lightweight installation processFully compatible with Microsoft Excel formats, including .xlsx and .xlsmFamiliar user interface requiring zero learning curveSupports advanced spreadsheet formatting and complex formula calculations
microsoft office alternative - wps office

Frequently Asked Questions

Can I conditionally format part of a formula result in Excel?

No, conditional formatting strictly applies to the entire cell and cannot style only a portion of a formula's output. To format partial text, you must convert the formula to static text and use a VBA macro to apply styling.

Does Excel for the Web support VBA for partial formatting?

No, VBA macros are not supported in Excel for the Web, iOS, or Android. You must use the desktop versions of Excel for Windows or Mac to run VBA scripts and format specific characters.

Is there a manual way to format only part of a cell?

Yes. Double-click the cell or press F2 to enter edit mode, highlight the specific characters you want to change, and apply formatting directly from the Home tab. However, this process cannot be automated via conditional formatting rules.