+ Reply to Thread
Results 1 to 7 of 7

Conditional formatting - highlight the most similar number

Hybrid View

  1. #1
    Registered User
    Join Date
    08-04-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    7

    Conditional formatting - highlight the most similar number

    Hello,

    Not sure if this will be possible, but I will ask anyway...

    Say I have the value 15.05 in a cell

    And then I have a range of numbers in other cells in a column, say: 14.00 15.00, 16.00 etc

    Can I use a conditional format rule to highlight the nearest number to 15.05, so in this case the cell wit 15.00 in it?

    Cheers, Jon

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Conditional formatting - highlight the most similar number

    Hello
    Maybe a Conditional Formatting formula will do the trick. For example, if your value of 15.05 is in cell D2 and you range of values in F2:F8, then the following Conditional Formatting formula would highlight the next lowest number to D2.

    =MATCH($D$2,$F$2:$F$8)=ROW()-1
    Note the -1 after the ROW function. If your range started in F3 for example then this would have to be -2 and so on.

    Hope this helps.
    DBY

  3. #3
    Registered User
    Join Date
    08-04-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Conditional formatting - highlight the most similar number

    Hi DBY,

    Thanks for your reply - unfortunately that doesn't work I am afraid.

    I am also trying to match it to the nearest number, rather than the next smallest number, and so it could be bigger or smaller.

    Any more suggestions?

    Cheers, Jon

  4. #4
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Conditional formatting - highlight the most similar number

    Hi
    Assuming you mean .5 and above goes to the next number, try this Conditional Formatting formula, as per the ranges in my previous formula:

    =MATCH(MROUND($D$2,1),$F$2:$F$8)=ROW()-1
    Hope this is more what you're after.
    DBY

  5. #5
    Registered User
    Join Date
    08-04-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Conditional formatting - highlight the most similar number

    Hi DBY,

    Thanks again for you post, but again, I am still struggling!

    Is it possible to post up an example worksheet? And if so, how?

    Cheers, Jon

  6. #6
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Conditional formatting - highlight the most similar number

    Hello Jon

    If you could upload a sample file it might make things a bit clearer. Below is a link to the forum FAQ's which tells you how to upload a file with your post.

    http://www.excelforum.com/faq.php?fa...b3_attachments

    DBY

  7. #7
    Registered User
    Join Date
    08-04-2012
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Conditional formatting - highlight the most similar number

    Hi DBY,

    Thanks for your response and apologies for the delay in posting an example.

    I hope the attached workbook makes sense - I have an example of the problem, and two examples of how the solution would look.

    Many thanks,

    Jon
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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