+ Reply to Thread
Results 1 to 2 of 2

Conditional Formatting of Duplicate of numerical values With Tolerance

  1. #1
    Registered User
    Join Date
    09-24-2015
    Location
    California, USA
    MS-Off Ver
    Excell 2013
    Posts
    1

    Conditional Formatting of Duplicate of numerical values With Tolerance

    Sorry if I should be posting my question in a different forum, please just let me know...

    I am trying to highlight on an Excel spreadsheet numerical values from experimental results (normally in decimal form with two or at most three decimal figures) that are equal or close in value within a certain tolerance (that I would like to be able to specify).
    The built-in macros of excel allow me for detecting the exact "duplicates" (to the last digit) but I cannot detect those numbers that are close. For example I cannot make it recognize that 34.561 is almost the same as 34.558 and I would like to see them highlighted with the same background color. I don't want to round the values either, but keep the original numerical information that has been recorded in the experiment.

    Is there any macro combination I could use?
    Thank you for any help/guidance!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Conditional Formatting of Duplicate of numerical values With Tolerance

    Hi, we3lcome to the forum

    1st thing you need to know about Conditional Formatting, is that it only works on TRUE or FALSE. As such, you can create test formulas IN the worksheet, based on your data, to see how they work. Below I have done that...
    A
    B
    C
    2
    1.234
    FALSE
    1.25
    3
    1.244
    FALSE
    1.27
    4
    1.254
    TRUE
    5
    1.264
    TRUE
    6
    1.274
    FALSE
    7
    1.284
    FALSE
    8
    1.294
    FALSE
    9
    1.304
    FALSE
    10
    1.314
    FALSE

    Your data would be in A2:A10
    C2=lower limit
    C3=Upper limit
    B2=AND(A2>=$C$2,A2<=$C$3)
    copied down.

    You can see that is works, because A4 and A5 show TRUE.
    Now you just need to plug that formula (rule) int CF.

    1. highlight the range you want to apply the conditional formatting to (A2:A10 in my sample)
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter =AND(A2>=$C$2,A2<=$C$3) format fill as needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Sorting on duplicate values (Conditional Formatting)
    By davecut85 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-15-2015, 06:01 PM
  2. [SOLVED] Help with Conditional Formatting Duplicate Values
    By alcharbonneau in forum Excel General
    Replies: 6
    Last Post: 02-26-2013, 09:09 PM
  3. Conditional formatting for duplicate values
    By kris26 in forum Excel - New Users/Basics
    Replies: 12
    Last Post: 03-21-2012, 06:51 AM
  4. Ignore Duplicate Values In Conditional Formatting
    By mightyeskimo in forum Excel General
    Replies: 13
    Last Post: 09-18-2010, 01:28 PM
  5. Replies: 1
    Last Post: 08-18-2010, 02:00 PM
  6. Conditional Formatting- Highlight Duplicate Values
    By Christopher_1 in forum Excel General
    Replies: 4
    Last Post: 04-21-2010, 11:02 AM
  7. Conditional formatting with a % tolerance
    By Redder Lurtz in forum Excel General
    Replies: 7
    Last Post: 09-01-2009, 06:45 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1