+ Reply to Thread
Results 1 to 6 of 6

UDF array function doesn't return array

  1. #1
    Registered User
    Join Date
    01-15-2016
    Location
    tissi
    MS-Off Ver
    1998
    Posts
    3

    UDF array function doesn't return array

    I'm trying to create that would resample a range by basically repeating values gain. For example {1,2,3} would become {1,1,2,2,3,3}. For some reason my function only returns 0 all the time. Can someone help?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: UDF array function doesn't return array

    If you are outputting to the cells, how are you entering the formula?

    You need to select few cells (3 or 4 or even more) and enter the formula and confirm with ctrl + shift + enter.

  3. #3
    Registered User
    Join Date
    01-15-2016
    Location
    tissi
    MS-Off Ver
    1998
    Posts
    3

    Re: UDF array function doesn't return array

    Yeah, I tried to do it that way but it just returns "0" several times. Weird thing is that if I make it return say upArray(3) to see if it creates the array the correct way it works and shows the correct value. Only when I try to get it return the whole array it breaks.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: UDF array function doesn't return array

    Aren't you try to outputting vertically?
    If so, the formula should look like
    =transpose(test(a1:a5,3))
    and confirm with ctrl + shift + enter.

  5. #5
    Registered User
    Join Date
    01-15-2016
    Location
    tissi
    MS-Off Ver
    1998
    Posts
    3

    Re: UDF array function doesn't return array

    Ah, this helped. Thank you!

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: UDF array function doesn't return array

    And change to
    Please Login or Register  to view this content.
    Otherwise you will always get 0 in the first cell unless you declare Option Base 1.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Search an array with an array and return matching value
    By cheal2 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-23-2013, 04:15 PM
  2. Why doesn't this array function work?
    By OldManExcellor in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-24-2013, 10:03 AM
  3. Suppose to return an array, but doesn't :(
    By gosbra in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-04-2013, 10:49 PM
  4. Find a value in an array and return multiple values in an adjacent array
    By tonbra in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2012, 08:35 PM
  5. Function that return Array
    By yellowpower in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-08-2011, 06:08 AM
  6. Function to return Array
    By Zandor435 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-25-2008, 06:11 PM
  7. Using Vlookup to lookup array, return array
    By jcampbell in forum Excel General
    Replies: 5
    Last Post: 11-16-2007, 01:13 PM
  8. [SOLVED] Return Array from Function
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2006, 03:55 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1