+ Reply to Thread
Results 1 to 4 of 4

Cannot use the COLUMN() function in an array?

  1. #1
    Forum Contributor
    Join Date
    01-15-2013
    Location
    London
    MS-Off Ver
    Excel 2003, 2007, 2010, 2019
    Posts
    436

    Cannot use the COLUMN() function in an array?

    Hi sir,

    Can I ask why the array formula below failed to work?

    =PRODUCT(1+OFFSET($A$1,0,0,COLUMN($C$1)-COLUMN($A$1),1))

    It worked nicely if I replace COLUMN($C$1) with 3, and COLUMN($A$1) with 1.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Cannot use the COLUMN() function in an array?

    Hi,

    When array-entered, Excel is expecting an array to be returned from the COLUMN functions. This conflicts with the single value (e.g. 2 - effectively {2} here) you are returning. You could first coerce this into a scalar quantity before passing to the OFFSET:

    =PRODUCT(1+OFFSET($A$1,0,0,SUM(COLUMN($C$1)-COLUMN($A$1)),1))

    though it is more than likely that there will be a better solution. Can I ask you why the two COLUMN functions? Particularly since they are absolute references, so I can't imagine you, for example, dragging this formula to further cells?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Contributor
    Join Date
    01-15-2013
    Location
    London
    MS-Off Ver
    Excel 2003, 2007, 2010, 2019
    Posts
    436

    Re: Cannot use the COLUMN() function in an array?

    HI XOR LX,

    Thanks for the great advice and help. I tried to use some 'relative' position for the calculation. This is an example.

    I will later change $C$1 to COLUMN() so that the position can be updated for difference cell locations.

    Good knowledge to know the behavior of the COLUMN() function. Thank you!


    Quote Originally Posted by XOR LX View Post
    Hi,

    When array-entered, Excel is expecting an array to be returned from the COLUMN functions. This conflicts with the single value (e.g. 2 - effectively {2} here) you are returning. You could first coerce this into a scalar quantity before passing to the OFFSET:

    =PRODUCT(1+OFFSET($A$1,0,0,SUM(COLUMN($C$1)-COLUMN($A$1)),1))

    though it is more than likely that there will be a better solution. Can I ask you why the two COLUMN functions? Particularly since they are absolute references, so I can't imagine you, for example, dragging this formula to further cells?

    Regards

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Cannot use the COLUMN() function in an array?

    You're welcome.

+ 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. VLOOKUP array function returns the same column
    By murphy_sj in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-15-2012, 12:35 AM
  2. Single Conditional Array x two Multi-Column Array - Approach needed
    By David Brown in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-28-2010, 11:41 AM
  3. Referring to an array column or row of LinEst function
    By HammerTime in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-14-2010, 01:11 AM
  4. Replies: 2
    Last Post: 08-18-2009, 01:45 PM
  5. How to return multiple column array without using Offset function?
    By agarwaldvk in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-27-2008, 04:20 AM

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