Find closest match, excluding current row

zakakatz

New Member
Joined
Feb 19, 2014
Messages
2
I've been browsing the forum, and found several relevant examples but can't quite adapt them for my fairly simple need. I am looking to set up a formula in column C, to return the closest matching store (column A) of previous 3 months sales (column B). For example, Store 1 (A2) closest match would be store 13 (A14) based on store 13's sales (99.76) being closest to store 1's 130.94. The one caveat I'm running into, is that with all of the formula's I've tried, it always returns the value from the originating row (ie. my formula's return A2). I know I need to throw in a IF condition with <> A2, however doing so breaks the rest of my formula. Can anyone help?
Store#Prev 3 Month SalesClosest Match
1130.94
241.52
394.65
458.17
563.12
697.92
731.34
855.44
966.54
1072.74
1158.05
1285.6
1399.76
1473.87
1580.5
1655.38
1742.41
1851.48
1970.41
2065.72

<colgroup><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
This seems to work. It is an array formula so hit ctrl+shift+enter after pasting it in.

Code:
=INDEX($A$2:$A$21,MATCH(MIN(IF($B$2:$B$21<>B2,ABS(B2-$B$2:$B$21))),ABS(B2-$B$2:$B$21),0))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,340
Messages
6,124,382
Members
449,155
Latest member
ravioli44

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top