Results 1 to 4 of 4

Thread: Comparing Numbers + closest match

  1. #1

    Comparing Numbers + closest match



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hello everyone,

    Can anyone help me with a formula that will use a range of cells and compare them.

    I have 2 columns of cells filled with ascending and descending positive and negative

    numbers.
    ------------------
    Example
    ------------------
    56 120
    58.4 118
    60 116
    65 112.3
    70 108.56
    72 106
    ... ...
    ... ...
    92 90
    ... ...
    ... ...
    197 2
    200 0
    202 -2
    ... ...
    ... ...

    -------------------
    I would like the formula to search these 2 columns for the closest matches, which are 92
    and 90 and highlight them or bring them to a different cell.

    Further, I would like a formula that will give me the highest positive with the lowest
    positive i.e. 200 and 0

    the other two columns are exatcly the same but the ascending and descending order is
    reversed.

    Thanks a lot in advance guys

    franky

  2. #2
    Super Moderator JoePublic's Avatar
    Join Date
    Sep 2011
    Location
    Askew
    Posts
    170
    Articles
    0
    You could do the highlighting with conditional formatting based on a formula:
    =ABS($A1-$B1)=MIN(ABS($A$1:$A$14-$B$1:$B$14))
    adjusting ranges to suit.


    Just noticed - cross-posted here.
    Last edited by JoePublic; 2011-11-16 at 02:58 PM.
    Circumference of a circle = 2πr²



    ²the circle's radius

  3. #3
    thanks for that mate.

    honestly, i didn't know in which forum to post. sorry for braking the rules

    I will try that, thanks again

  4. #4
    Administrator Ken Puls's Avatar
    Join Date
    Mar 2011
    Location
    Nanaimo, BC, Canada
    Posts
    2,021
    Articles
    79
    Blog Entries
    14
    Hi Franky,

    Doesn't really matter which forum you pick, but you should try to pick one... especially if you get an answer in 16 minutes.

    You may want to have a read of This article
    Ken Puls, FCPA, FCMA, MS MVP (Excel)

    Master your data with Power Query: Purchase your copy of my book M is for Data Monkey today!

    Main Site: http://www.excelguru.ca -||- Blog: http://www.excelguru.ca/blog -||- Forums: http://www.excelguru.ca/forums
    Check out the Excelguru Facebook Fan Page -||- Follow Me on Twitter

    If you've been given VBA code (a macro) for your solution, but don't know where to put it, CLICK HERE.

Posting Permissions

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