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

Data Analysis

  • How To Create Frequency Distribution in Excel
  • How To Compare Two Lists in Excel
  • Conditional Formatting Data bars Examples in Excel
  • How to do a t-Test in Excel?
  • Remove Duplicates Example in Excel

References

  • Count rows with at least n matching values
  • CHOOSE function: Description, Usage, Syntax, Examples and Explanation
  • How to calculate two-way lookup VLOOKUP in Excel Table
  • How to use Excel MATCH Function
  • Find Closest Match in Excel Using INDEX, MATCH, ABS and MIN functions

Data Validations

  • Excel Data validation date in next 30 days
  • Excel Data validation specific characters only
  • Data validation must not exist in list
  • Excel Data validation with conditional list
  • Excel Data validation must begin with

Highlight cells that end with in Excel

by

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

Formula

=COUNTIF(A1,"*text")

Explanation

Note: Excel contains many built-in rules for highlighting values with conditional formatting, including a rule to highlight cells that end 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 end with certain text, you can use a simple formula based on the COUNTIF function. For example, if you want to highlight states in the range B4:G12 that end with “ota”, you can use:

=COUNTIF(B4,"*ota")

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.

Worked Example:   Example of Count with Or Criteria in Excel

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 the reference to B4 will change to the address of each cell being evaluated, since it is a relative address.

The formula itself uses the COUNTIF function to “count” cells that end with “ota” using the pattern “*ota” which uses a wildcard (*) to match any sequence of characters followed by “ota”. From a practical standpoint, we are only counting 1 cell each time, which means we are either going to get back a 1 or a zero, which works perfectly for conditional formatting.

Worked Example:   How to translate letters to numbers in Excel

A simpler, more flexible rule using named ranges

By naming an input cell as a named range and referring to that name in the formula, you can make the formula more powerful and flexible. For example, if you name G2 “input”, you can rewrite the formula like so:

=COUNTIF(B4,"*"&input)

This formula simply adds “*” to the beginning of whatever you put in the input cell. As a result, the conditional formatting rule will respond instantly whenever that value is changed.

Worked Example:   Highlight dates in same month and year in Excel

Case sensitive option

COUNTIF is not case-sensitive, so if you need to check case as well, you can use a more complicated formula that relies on the RIGHT function together with EXACT:

=EXACT(RIGHT(A1,LEN(substring)),substring)

In this case, RIGHT extracts text from the right of each cell, and only the number of characters in the substring you are looking for, which is supplied by LEN. Finally EXACT compares the extracted text to the text you are looking for (the substring). EXACT is case-sensitive, so only will return TRUE when all characters match exactly.

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

  • How to use Excel NOT Function
  • TRUE function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel XOR Function
  • Complete List of Excel Logical Functions, References and Examples
  • How to use Excel FALSE Function

Date Time

  • Add workdays no weekends in Excel
  • YEAR function: Description, Usage, Syntax, Examples and Explanation
  • How to calculate months between dates in Excel
  • Get last working day in month in Excel
  • Get first Monday before any date in Excel

Grouping

  • Group numbers at uneven intervals in Excel
  • Map text to numbers in Excel
  • How to randomly assign people to groups in Excel
  • Running count group by n size in Excel
  • Map inputs to arbitrary values in Excel

General

  • How to Create Calendar in Excel
  • With vs Without Array Formula in Excel
  • 231 Keyboard Shortcut Keys In Excel
  • How to calculate percent variance in Excel
  • Excel Autofill Cell Ranges, Copy, Paste
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning