Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default MATCH does not work on a UDF-generated array

Hi there

Can anybody explain why I have this particular problem?

I have written a UDF that outputs a 2-dimensional array. If this UDF is
called F(x) why does the following give a #N/A error?

MATCH(X6,F(x))

If I can't find a way to make this work then I guess I'll have to write
a UDF of my own to solve the problem.

Cheers.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default MATCH does not work on a UDF-generated array

A UDF cannot change anything in a workbook.

If that is not an answer to your question; what is the code of your UDF and what are the values of the cells involved?

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"pinkfloydfan" wrote in message oups.com...
| Hi there
|
| Can anybody explain why I have this particular problem?
|
| I have written a UDF that outputs a 2-dimensional array. If this UDF is
| called F(x) why does the following give a #N/A error?
|
| MATCH(X6,F(x))
|
| If I can't find a way to make this work then I guess I'll have to write
| a UDF of my own to solve the problem.
|
| Cheers.
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default MATCH does not work on a UDF-generated array

Hi Niek

The UDF is not changing anything on the workbook. The code is too
complex but suffice to say that on its own it works fine...it outputs a
2-column set of results where the first column is a list of dates and
the second is a list of numbers associated with each date.

I don't want to have to perform the MATCH (or a VLOOKUP) on the output
as that would be unwieldy...it would be much neater if I could use the
UDF as an indirect reference to an array within MATCH.

Does that make sense?

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 200
Default MATCH does not work on a UDF-generated array

pinkfloydfan wrote:
Hi Niek

The UDF is not changing anything on the workbook. The code is too
complex but suffice to say that on its own it works fine...it outputs a
2-column set of results where the first column is a list of dates and
the second is a list of numbers associated with each date.

I don't want to have to perform the MATCH (or a VLOOKUP) on the output
as that would be unwieldy...it would be much neater if I could use the
UDF as an indirect reference to an array within MATCH.

Does that make sense?

Thanks

What is X6?

Alan Beban
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default MATCH does not work on a UDF-generated array

Any cell reference you want...



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default MATCH does not work on a UDF-generated array

When you say your function returns a 2D array do you mean multi row in two
columns.

If so the Match function needs a single row or column.

If you want to match say the second column of the array returned by the UDF
try

=MATCH(X6,index(F(x),,2)

I assume X6 is a cell ref & x is a value being the UDF arg'

Regards,
Peter T


"pinkfloydfan" wrote in message
oups.com...
Hi there

Can anybody explain why I have this particular problem?

I have written a UDF that outputs a 2-dimensional array. If this UDF is
called F(x) why does the following give a #N/A error?

MATCH(X6,F(x))

If I can't find a way to make this work then I guess I'll have to write
a UDF of my own to solve the problem.

Cheers.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default MATCH does not work on a UDF-generated array

Perfect!

Thanks a lot Peter

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default MATCH does not work on a UDF-generated array

I omitted the closing bracket (in my previous post)

=MATCH(X6,index(F(x),,2)


=MATCH(X6,index(F(x),,2))

Glad you got it working

Regards,
Peter T

"pinkfloydfan" wrote in message
ups.com...
Perfect!

Thanks a lot Peter



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
Match using array of column and row references to match with jkfin1 Excel Worksheet Functions 1 September 16th 08 04:39 PM
Having trouble getting MATCH to work with a variable lookup array Chuck M Excel Worksheet Functions 3 August 20th 08 11:45 PM
Can't get array formula to work in MATCH function Chas Grad Excel Worksheet Functions 5 May 12th 08 09:19 PM
index match array function-returning only first match, need last. Julie Olsen Excel Worksheet Functions 3 December 29th 06 12:50 AM
Error Generated from Array formula ExcelMonkey[_190_] Excel Programming 6 March 14th 05 12:41 PM


All times are GMT +1. The time now is 10:08 PM.

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

About Us

"It's about Microsoft Excel"