Index and match values closest to zero and return the value on the left column

mcva

New Member
Joined
Apr 20, 2020
Messages
37
Office Version
  1. 365
Platform
  1. Windows
Hi,
I need to get the number included on the Segment column that corresponds to the value of the column Value that is closest to zero.

I have tried this:
=INDEX($A$2:$A$12,MATCH(MIN(ABS(IF(ISNUMBER(D2:D12),D2:D12,9999))),D2:D12, FALSE),1)

, however, I´m getting #N/A when the values in the column Value are negative.

I have included the file in the following link.


Thank you
 

Attachments

  • test.jpg
    test.jpg
    157.3 KB · Views: 19

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Try this

Book1
ABCDEFGHI
1mentVariableValueResult (obtained)Result (correct)
23Age 7.5703Age 1212
34Age 5.0985Algae 1313
45Age 5.5075
56Age 8.1797
67Age 5.7631
78Age 4.172
89Age 2.773
910Age 1.9327
1011Age 0.6872
1112Age 0.0672
1213Age -1.3081
133Algae -6.8438
144Algae -4.9515
155Algae -7.0199
166Algae -9.7278
177Algae -8.6744
188Algae -8.915
199Algae -8.0765
2010Algae -6.9841
2111Algae -6.1208
2212Algae -4.8454
23C22
2413Algae -3.5196
Sheet1
Cell Formulas
RangeFormula
F2:F3F2=INDEX($A$2:$A$24,MATCH(AGGREGATE(15,6,ABS($C$2:$C$24)/($B$2:$B$24=E2),1),ABS($C$2:$C$24)/($B$2:$B$24=E2),0))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 1
Solution
Try this

Book1
ABCDEFGHI
1mentVariableValueResult (obtained)Result (correct)
23Age 7.5703Age 1212
34Age 5.0985Algae 1313
45Age 5.5075
56Age 8.1797
67Age 5.7631
78Age 4.172
89Age 2.773
910Age 1.9327
1011Age 0.6872
1112Age 0.0672
1213Age -1.3081
133Algae -6.8438
144Algae -4.9515
155Algae -7.0199
166Algae -9.7278
177Algae -8.6744
188Algae -8.915
199Algae -8.0765
2010Algae -6.9841
2111Algae -6.1208
2212Algae -4.8454
23C22
2413Algae -3.5196
Sheet1
Cell Formulas
RangeFormula
F2:F3F2=INDEX($A$2:$A$24,MATCH(AGGREGATE(15,6,ABS($C$2:$C$24)/($B$2:$B$24=E2),1),ABS($C$2:$C$24)/($B$2:$B$24=E2),0))
Press CTRL+SHIFT+ENTER to enter array formulas.
Thank you very much, much better
 
Upvote 0

Forum statistics

Threads
1,223,902
Messages
6,175,278
Members
452,629
Latest member
SahilPolekar

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