+ Reply to Thread
Results 1 to 12 of 12

Conditional Formatting (Highest value closest to that of a cell)

  1. #1
    Registered User
    Join Date
    11-22-2018
    Location
    Athens, Greece
    MS-Off Ver
    Office 2010
    Posts
    6

    Conditional Formatting (Highest value closest to that of a cell)

    Good day guys and sorry if such a question has been answered already in the past, but since I'm not an expert in Excel with conditional formatting, I would really like a "customized" advice.

    The scenario:

    Excel.jpg

    According to the Excel above, my intention is to find the value in columns F, I, L, O, R, U, W which is closest to the one in cell B44 but does not surpass it (meaning the highest closest which is lower than that).

    I did try the following syntax "=ABS(F6-$B$44)=MIN(ABS($F$6:$F$40-$B$44))" per column of interest, but as you can notice it only highlights the closest value, regardless the fact that it is higher than the B44 one. In this case, I need a formula that would highlight 44,7 from column F, 41 from column I etc, since these are the value which are closest to B44 one, without surpassing it.

    Any ideas?

    Already thankful for your kind support and advice.

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Conditional Formatting (Highest value closest to that of a cell)

    Can you attach a small sample workbook rather than an image?

    Go Advanced -> Manage Attachments -> Upload

  3. #3
    Registered User
    Join Date
    11-22-2018
    Location
    Athens, Greece
    MS-Off Ver
    Office 2010
    Posts
    6

    Re: Conditional Formatting (Highest value closest to that of a cell)

    Sure thing kersplash. Attached a sample.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Conditional Formatting (Highest value closest to that of a cell)

    Pl see file.
    In B45 then dragged across
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Registered User
    Join Date
    11-22-2018
    Location
    Athens, Greece
    MS-Off Ver
    Office 2010
    Posts
    6

    Re: Conditional Formatting (Highest value closest to that of a cell)

    Quote Originally Posted by kvsrinivasamurthy View Post
    Pl see file.
    In B45 then dragged across
    Please Login or Register  to view this content.
    Thank you very much for your trouble my friend, but I am afraid that the result is not what I was looking for. Specifically:

    1) Instead of having the values written in other cells, I would prefer it if the requested values were just highlighted in the specific columns (thus the different color of F18 and I17 that I tried the forumla), the moment you inserted a value in B41. This was achieved through the conditional formatting I mentioned initially, but the result was not correct.

    2) I am afraid that the formula you sent me was the exact opposite of what I was looking for. I think that it brings back the closest value per column higher than the B41 cell's value. What I need in particular is to have the closest value to the one in B41 that does not exceeds that. For example, the proper values that should be highlighted are the ones below:

    F = 44,7
    I = 41
    L = 43,4
    O = 45,9
    R = 41
    U = 43,3
    W = 45,2

    Hope I assist you some more.

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Conditional Formatting (Highest value closest to that of a cell)

    In B45 then copied across
    Please Login or Register  to view this content.

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,791

    Re: Conditional Formatting (Highest value closest to that of a cell)

    How about
    =ROW(F3)-2=MATCH(B$41,F$3:F$37,1)

  8. #8
    Registered User
    Join Date
    11-22-2018
    Location
    Athens, Greece
    MS-Off Ver
    Office 2010
    Posts
    6

    Re: Conditional Formatting (Highest value closest to that of a cell)

    Quote Originally Posted by kvsrinivasamurthy View Post
    In B45 then copied across
    Please Login or Register  to view this content.
    Thank you very much kvsrinivasamurthy. This formula does the trick and brings back the correct values per column.

    Still, though, the ideal scenario would be to highlight those values and not retrieve them and present them in others cells. Since I can not guarantee that something like that can be achieved after all, your solution is probably the next best thing, if I could also copy in a row below 45 the corresponding cells of column A. Something like the following:

    F ----- I ----- L ----- O ----- R ----- U ----- W
    44,7 -- 41 --- 43,4 --- 45,9 --- 41 --- 43,4 -- 45,2
    29 ---- 28 ---- 26 ---- 26 ----- 24 --- 24 ---- 24 (values copied from Column A)

    Hope the above makes sense. Any additional ides on that?

  9. #9
    Registered User
    Join Date
    11-22-2018
    Location
    Athens, Greece
    MS-Off Ver
    Office 2010
    Posts
    6

    Re: Conditional Formatting (Highest value closest to that of a cell)

    Quote Originally Posted by Fluff13 View Post
    How about
    =ROW(F3)-2=MATCH(B$41,F$3:F$37,1)
    I did try the above formula my friend, but all I got back was a "FALSE" result. With my limited knowledge on Excel, what I understand is that the above formula is searching for a value in F column that matches that of B41 cell, which is not what I am looking for.

    Btw, what is it with commas and question marks? It seems that in all the formulas above, I had to replace the commas with a question mark in order to work.

  10. #10
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Conditional Formatting (Highest value closest to that of a cell)

    Formula for CF in F3

    =F3=INDEX(F$3:F$37,AGGREGATE(14,6,ROW(F$3:F$37)/(F$3:F$37<$B$41),1)-ROW(F$3)+1)

    Then copy CF to other ranges using
    Copy --> Paste Special --> Formats.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    11-22-2018
    Location
    Athens, Greece
    MS-Off Ver
    Office 2010
    Posts
    6

    Re: Conditional Formatting (Highest value closest to that of a cell)

    That works wonders!!!

    Thank you very much for managing to provide the perfect solution after all. This is really amazing!

    Grateful for your effort and complete answer!

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,791

    Re: Conditional Formatting (Highest value closest to that of a cell)

    Quote Originally Posted by Sontal View Post
    I did try the above formula my friend, but all I got back was a "FALSE" result.
    That formula was for conditional formatting & should be used the same way as kvsrinivasamurthy did in the workbook in post#10

+ 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. Replies: 4
    Last Post: 07-25-2017, 03:56 PM
  2. conditional formatting - finding highest value
    By gocolonel77 in forum Excel General
    Replies: 2
    Last Post: 01-28-2015, 04:52 PM
  3. Conditional formatting - highest value of two columns
    By shreksbro in forum Excel General
    Replies: 1
    Last Post: 08-29-2012, 10:26 PM
  4. Replies: 3
    Last Post: 07-19-2012, 01:24 PM
  5. Replies: 3
    Last Post: 06-14-2009, 12:14 AM
  6. conditional formatting - Highest
    By QPapillon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-28-2006, 04:10 PM
  7. Conditional formatting highest 25% of a column
    By tlosgyl3 in forum Excel General
    Replies: 2
    Last Post: 01-18-2006, 06:40 AM

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