# Thread: Comparing Numbers + closest match

1. ## Comparing Numbers + closest match

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. 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.

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. 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

#### Posting Permissions

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