Problem with match function

johs32

New Member
Joined
Aug 21, 2017
Messages
11
I'm trying to use match, to find the relative position of the smallest number, in a large array of calculated data.

First, I use the "small" function, to find the smallest number in the array. (works fine)
Trying to match that number in the data array, gets me the "#N/A" error.

I am using "match type = 0", to find the exact match.

What can I be doing wrong?
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Are you using CTRL + SHIFT + ENTER to enter the formula as an array formula?

Caleeco
 
Upvote 0
The array consists of unsorted numbers, calculated by excel from other places in the workbook. But as I understand it, this shouldn't make a difference, when looking for a unique, exact match?
 
Upvote 0
Are you using CTRL + SHIFT + ENTER to enter the formula as an array formula?

Caleeco

If it is just a simple =match(small(range),range,0), then that is not an array formula, and could be entered in a regular way

Johs, what exactly is your formula?
If you are trying to return something based on the smallest value in a range, it should be something like this...
[Table="width:, class:grid"][tr][td] [/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][/tr]
[tr][td]
2​
[/td][td]aa[/td][td]
2​
[/td][td][/td][td][/td][/tr]

[tr][td]
3​
[/td][td]bb[/td][td]
3​
[/td][td][/td][td]dd[/td][/tr]

[tr][td]
4​
[/td][td]cc[/td][td]
5​
[/td][td][/td][td][/td][/tr]

[tr][td]
5​
[/td][td]dd[/td][td]
1​
[/td][td][/td][td][/td][/tr]

[tr][td]
6​
[/td][td]ee[/td][td]
5​
[/td][td][/td][td][/td][/tr]

[tr][td]
7​
[/td][td]ff[/td][td]
9​
[/td][td][/td][td][/td][/tr]
[/table]

D3=INDEX($A$2:$A$7,MATCH(SMALL($B$2:$B$7,1),$B$2:$B$7,0))
entered regularly
 
Upvote 0
Without seeing the actual formula and data it's impossible to say. These are just guesses.
Another possibility is the Floating Point Precision issue with storing decimal values in binary systems.

Try
=MATCH(ROUND(SMALL(Range,1),2),Range,0)

Change the 2 to whatever level of decimal is appropriate for your range of data
 
Last edited:
Upvote 0
If it is just a simple =match(small(range),range,0), then that is not an array formula, and could be entered in a regular way


Thanks, I thought so.

My (simplified) formula looks like this:
=MATCH(SMALL(GU13:GV40;1);GU13:GV40)

Could it be because i'm trying to use an array with multiple columns?
In that case, is there a workaround, for finding the position of the smallest number in a multiple-column array??
 
Upvote 0
You said
I am using "match type = 0", to find the exact match.

That is not the case in this formula
=MATCH(SMALL(GU13:GV40;1);GU13:GV40)

When the matchtype argument is omitted, as you have done here, then Match uses the matchtype 1

And yes, it's also because of the 2D range
Match will only work on a 1D range
 
Last edited:
Upvote 0
Without seeing the actual formula and data it's impossible to say. These are just guesses.
Another possibility is the Floating Point Precision issue with storing decimal values in binary systems.

Thanks, I thought about that too, but I have tried copying the calculated cells, pasting as values only, and using the formula on this "new" data with no result. Shouldn't that fix it?
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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