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

Data Analysis

  • Chart Axes in Excel
  • How to sum a total in multiple Excel tables
  • How to Create Thermometer Chart in Excel
  • How to create running total in an Excel Table
  • How to conditionally sum numeric data in an Excel table using SUMIFS

References

  • How to get last row in mixed data with blanks in Excel
  • How to calculate two-way lookup VLOOKUP in Excel Table
  • Find closest match in Excel
  • How to create dynamic named range with OFFSET in Excel
  • Count rows with at least n matching values

Data Validations

  • Excel Data validation number multiple 100
  • Excel Data validation date in next 30 days
  • Excel Data validation require unique number
  • Excel Data validation must contain specific text
  • Excel Data validation no punctuation

Highlight approximate match lookup conditional formatting in Excel

by

This tutorial shows how to Highlight approximate match lookup conditional formatting in Excel using the example below;

Formula

=OR($B5=LOOKUP(width,widths),B$5=LOOKUP(height,heights))

Explanation

To highlight rows and columns associated with an approximate match, you can use conditional formatting with a formula based on the LOOKUP function together with with a logical function like OR or AND. In the example shown, the formula used to apply conditional formatting is:

=OR($B5=LOOKUP(width,widths),B$5=LOOKUP(height,heights))

How this formula works

This formula uses 4 named ranges, defined as follows:

width=K6
height=K7
widths=B6:B11
heights=C5:H5

Conditional formatting is evaluated relative to every cell it is applied to, starting with the active cell in the selection, which is cell B5 in this case. To highlight the matching row, we use this logical expression:

$B5=LOOKUP(width,widths)

The reference to B5 is mixed, with the column locked and row unlocked, so that only values in column B (widths) are compared to the value in K6 (width). In the example shown, this logical expression will return TRUE for every cell in a row where width is 200, based on an approximate match of the value in K6 (width, 275) against all values in K6:B11 (widths). This is done with LOOKUP function:

LOOKUP(width,widths)

Like the MATCH function, LOOKUP will run through sorted values until a greater value is found, then “step back” to the previous value, which is 200 in this case.

Worked Example:   Match first occurrence does not contain

To highlight the matching column, we use this logical expression:

B$5=LOOKUP(height,heights)

The reference to B5 is mixed, with the column relative and row absolute, so that only values in row 5 (heights) are compared to the value in K7 (height). In the example shown, this logical expression will return TRUE for every cell in a row where height is 300, based on an approximate match of the value in K7 (height, 325) against all values in C5:H5 (heights). This is done with LOOKUP function:

LOOKUP(height,heights)

As above, LOOKUP will run through sorted values until a greater value is found, then “step back” to the previous value, which is 300 in this case.

Worked Example:   Highlight dates between in Excel

Highlight intersection only

To highlight the intersection only, just replace the OR function with the AND function:

=AND($B5=LOOKUP(width,widths),B$5=LOOKUP(height,heights))

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

  • IFNA function: Description, Usage, Syntax, Examples and Explanation
  • Nested IF function example in Excel
  • IF with wildcards in Excel
  • How to use Excel XOR Function
  • SWITCH function example in Excel

Date Time

  • Convert Unix time stamp to Excel date
  • How to calculate workdays per month in Excel
  • Calculate time difference in hours as decimal value in Excel
  • How to determine year is a leap year in Excel
  • Basic Overtime Calculation Formula in Excel

Grouping

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

General

  • Convert column letter to number in Excel
  • Flash Fill in Excel
  • How to calculate percent of goal in Excel
  • How to add sequential row numbers to a set of data in Excel
  • How to get original price from percentage discount in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning