Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 42
Default Problem with MATCH function

In Excel 2007 I am using the MATCH function and trying to return the next
greatest value. For some reason, entering -1 as the match type is returning
a #N/A error. I tried a very simple example and it is still returning the
same error. In cells A1:A10 I have the values 1 through 10 (in ascending
order). In cell B1 I have:
=MATCH(5.7,A1:A10,-1). I would think this should return 6 because it rounds
up to 6 which is in the sixth row of the array.

Please help.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 175
Default Problem with MATCH function

using -1 requires that the lookup_array must be placed in descending order and
will finds the smallest value that is greater than or equal to lookup_value

if you want to return 6 for 5.7 as lookup value, try
=MATCH(MROUND(5.7,1),A1:A10,0)

Hope this is helpful

Pls click the Yes button below if this post provide answer you have asked


Thank You

cheers, francis










"DoubleZ" wrote:

In Excel 2007 I am using the MATCH function and trying to return the next
greatest value. For some reason, entering -1 as the match type is returning
a #N/A error. I tried a very simple example and it is still returning the
same error. In cells A1:A10 I have the values 1 through 10 (in ascending
order). In cell B1 I have:
=MATCH(5.7,A1:A10,-1). I would think this should return 6 because it rounds
up to 6 which is in the sixth row of the array.

Please help.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Problem with MATCH function

On Mon, 9 Mar 2009 10:49:02 -0700, DoubleZ
wrote:

In Excel 2007 I am using the MATCH function and trying to return the next
greatest value. For some reason, entering -1 as the match type is returning
a #N/A error. I tried a very simple example and it is still returning the
same error. In cells A1:A10 I have the values 1 through 10 (in ascending
order). In cell B1 I have:
=MATCH(5.7,A1:A10,-1). I would think this should return 6 because it rounds
up to 6 which is in the sixth row of the array.

Please help.


That parameter tells the MATCH function which way the array is sorted.

Here's a different approach to return the value equal to value given or the
next higher value in a field that is sorted ascending:

=LARGE(A1:A10,COUNT(A1:A10)-COUNTIF(A1:A10,"<5.7"))

or, if you put the 5.7 in a cell, so that value can be easily changed:


=LARGE(A1:A10,COUNT(A1:A10)-COUNTIF(A1:A10,"<" &B1))

If you always want to return the next higher value, even when there is an exact
match, then change the "<" to "<="

--ron
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 42
Default Problem with MATCH function

Thanks Francis. I would have thought that Excel would have mentioned the
descending order a little more clearly. However, it does make sense. Thanks
again for you help.

DoubleZ

"francis" wrote:

using -1 requires that the lookup_array must be placed in descending order and
will finds the smallest value that is greater than or equal to lookup_value

if you want to return 6 for 5.7 as lookup value, try
=MATCH(MROUND(5.7,1),A1:A10,0)

Hope this is helpful

Pls click the Yes button below if this post provide answer you have asked


Thank You

cheers, francis










"DoubleZ" wrote:

In Excel 2007 I am using the MATCH function and trying to return the next
greatest value. For some reason, entering -1 as the match type is returning
a #N/A error. I tried a very simple example and it is still returning the
same error. In cells A1:A10 I have the values 1 through 10 (in ascending
order). In cell B1 I have:
=MATCH(5.7,A1:A10,-1). I would think this should return 6 because it rounds
up to 6 which is in the sixth row of the array.

Please help.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Problem with MATCH function

On Mon, 09 Mar 2009 14:25:31 -0400, Ron Rosenfeld
wrote:

That parameter tells the MATCH function which way the array is sorted.

Here's a different approach to return the value equal to value given or the
next higher value in a field that is sorted ascending:


Oops, that was from something else -- the range does not need to be sorted to
use this formula"



=LARGE(A1:A10,COUNT(A1:A10)-COUNTIF(A1:A10,"<5.7"))

or, if you put the 5.7 in a cell, so that value can be easily changed:


=LARGE(A1:A10,COUNT(A1:A10)-COUNTIF(A1:A10,"<" &B1))

If you always want to return the next higher value, even when there is an exact
match, then change the "<" to "<="

--ron

--ron


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 42
Default Problem with MATCH function

Thank you Ron. That is a very clever formula and I'm sure I'll use it a lot
in the future.

"Ron Rosenfeld" wrote:

On Mon, 9 Mar 2009 10:49:02 -0700, DoubleZ
wrote:

In Excel 2007 I am using the MATCH function and trying to return the next
greatest value. For some reason, entering -1 as the match type is returning
a #N/A error. I tried a very simple example and it is still returning the
same error. In cells A1:A10 I have the values 1 through 10 (in ascending
order). In cell B1 I have:
=MATCH(5.7,A1:A10,-1). I would think this should return 6 because it rounds
up to 6 which is in the sixth row of the array.

Please help.


That parameter tells the MATCH function which way the array is sorted.

Here's a different approach to return the value equal to value given or the
next higher value in a field that is sorted ascending:

=LARGE(A1:A10,COUNT(A1:A10)-COUNTIF(A1:A10,"<5.7"))

or, if you put the 5.7 in a cell, so that value can be easily changed:


=LARGE(A1:A10,COUNT(A1:A10)-COUNTIF(A1:A10,"<" &B1))

If you always want to return the next higher value, even when there is an exact
match, then change the "<" to "<="

--ron

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with MATCH () function . . . Blue Max Excel Worksheet Functions 2 December 12th 08 01:38 AM
Problem with using match function Montu Excel Worksheet Functions 1 December 29th 07 06:12 PM
Match function problem SJC Excel Worksheet Functions 3 September 14th 07 06:02 PM
MATCH function problem LACA Excel Discussion (Misc queries) 10 May 22nd 06 01:39 AM
Problem with match function nander Excel Discussion (Misc queries) 4 April 18th 06 10:08 PM


All times are GMT +1. The time now is 10:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"