Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Filter Data Based on Date in Excel
  • How to calculate current stock or inventory in Excel
  • Data Series in Excel
  • Get column index in Excel Table
  • Conflicting Multiple Conditional Formatting Rules in Excel

References

  • How to create dynamic named range with OFFSET in Excel
  • Complete List of Excel Lookup and Reference Functions, References and Examples
  • How to use Excel MMULT Function
  • How to use Excel INDIRECT Function
  • MATCH function: Description, Usage, Syntax, Examples and Explanation

Data Validations

  • How To Create Drop-down List in Excel
  • Excel Data validation with conditional list
  • Excel Data validation unique values only
  • Excel Data validation exists in list
  • Excel Data validation must begin with

Highlight cells that begin with in Excel

by

This tutorial shows how to Highlight cells that begin with in Excel using the example below;

Formula

=SEARCH("substring",A1)=1

Explanation

Note: Excel contains many built-in “presets” for highlighting values with conditional formatting, including a preset to highlight cells that begin with specific text. However, if you want more flexibility, you can use your own formula, as explained in this article.

If you want to highlight cells that begin with certain text, you can use a simple formula that returns TRUE when a cell starts with the text (substring) you specify.

Worked Example:   How to check if cell contains one of many things in Excel

For example, if you want to highlight any cells in the range B4:G12 that start with “mi”, you can use:

=SEARCH("mi",B4)=1

Note: with conditional formatting, it’s important that the formula be entered relative to the “active cell” in the selection, which is assumed to be B4 in this case.

How this formula works

When you use a formula to apply conditional formatting, the formula is evaluated relative to the active cell in the selection at the time the rule is created. In this case, the rule is evaluated for each cell in B4:G12, and B4 will change to the address of the cell being evaluated each time, since it is entered as a relative address.

Worked Example:   Sum if one criteria multiple columns in Excel

The formula itself uses the SEARCH function to match cells that begin with “mi”. SEARCH returns a number that indicates position when the text is found, and a #VALUE! error if not. When SEARCH returns the number 1, we know that the cell value begins with “mi”. The formula returns TRUE when the position is 1 and FALSE for any other value (including errors).

Worked Example:   How to get first word in Excel

With a named input cell

If you use a named range to name an input cell (i.e. name G2 “input”), you can simply for the formula and make a much more flexible rule:

=SEARCH(input,B4)=1

Then when you change the value in “input”, the conditional formatting will instantly be updated.

Case sensitive option

SEARCH is not case-sensitive, so if you need to check case as well, you can use the FIND function instead:

=FIND(input,B4)=1

The FIND function works like SEARCH, but is case-sensitive.

Post navigation

Previous Post:

VLOOKUP without #N/A error in Excel

Next Post:

How to Create Gantt Chart in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • AND function: Description, Usage, Syntax, Examples and Explanation
  • NOT function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel OR Function
  • OR function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel XOR Function

Date Time

  • Get day name from date in Excel
  • Convert date string to date time in Excel
  • Get work hours between dates and times in Excel
  • Calculate date overlap in days in Excel
  • SECOND function: Description, Usage, Syntax, Examples and Explanation

Grouping

  • How to randomly assign data to groups in Excel
  • Calculate conditional mode with criteria in Excel
  • Categorize text with keywords in Excel
  • Group arbitrary text values in Excel
  • Group numbers at uneven intervals in Excel

General

  • Find, Trace and Correct Errors in Excel Formulas using ‘Formula Auditing’
  • Cell References: Relative, Absolute and Mixed Referencing Examples
  • How to calculate project complete percentage in Excel
  • AutoRecover file that was never saved in Excel
  • How to Insert Cells, Row and Rows in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning