Adding another Criteria help needed

COMike

New Member
Joined
Feb 6, 2018
Messages
1
I have a data set where I need to find the closest 3 results of a given number.

column a

speed
47
36
12
6
1

column b
group
1
2
2
2
1


Given number "25" in c5

I want to be able to have the closest numbers to "25" in each group

I can get the closest to it using =INDEX($A$1:$B$5,MATCH(MIN(ABS($A$1:$B$5-$C$5)),ABS($A$1:$B$5-$C$5),0)) for the first closest number, and then

=MAX(IF($a$1:$a$5<$c$5,$b$1:$b$5)) and the min version as well for the 2nd 2 returns. However I can get the formula to only give the results for each group.

How can I put the extra criteria on those formulas to account for the group.

Thoughts?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

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