+ Reply to Thread
Results 1 to 8 of 8

Formula with ROWS Function appears not to return correct number of rows

  1. #1
    Registered User
    Join Date
    02-21-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    4

    Formula with ROWS Function appears not to return correct number of rows

    I am trying to get right a complex formula in excel 2013 and the issue seems to be that the ROWS function at the end of the function fails to count the number of rows because the $ and the absence of the $ are not working, and the Rows formula is always returning the 1st row of the array.

    The complete expression is

    =INDEX(input, SMALL(IF((INDEX(input, ,$O$103, 1)<=$O$101)*(INDEX(input, ,$O$103, 1)>=$O$102), ROW(input)-MIN(ROW(input))+1, ""), ROWS(A$106:A106)),, 1)

    Input is an array referenced by the above formula which is entered as an array formula further down the sheet. The objective is to return rows which match specific criteria defined as constants in the sheet ($O$103=1 representing column 1 of the array, $O$101 and $O$102 are alphabetic and define the criteria to return the row (e.g. rows with contents between AB and CD). The problem is that the ROWS function ALWAYS returns 1 (being the number of rows. The expression does not change further down the sheet i.e. ROWS(a106:a106).

    The above expression is entered as an array formula

    I have uploaded a spreadsheet created in excel 2013 with this problem

    Any help would be more than appreciated

    richard
    Attached Files Attached Files
    Last edited by rzw30; 02-21-2013 at 10:05 AM.

  2. #2
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: problem with complex formula

    Hi rzw30

    Might be a good idea to upload a sample file with dummy data, and your expected result.
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: problem with complex formula

    rzw30,

    Please take a moment to read the forum rules and then amend your thread title to something descriptive of your problem. Once you have done this please send me a PM and I will remove this request.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    02-21-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: problem with complex formula

    Thanks for the advice, Kevin. I have uploaded a sample sheet and changed the title of my original post

    rgds

    Richard (rzw30)

  5. #5
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Formula with ROWS Function appears not to return correct number of rows

    Hi rzw30

    Sorry, but what is the result that you require.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Formula with ROWS Function appears not to return correct number of rows

    There's a difference between entering an array formula in a single cell and copying and entering in a whole range - you have done the latter so the ROWS part doesn't increment. Try deleting the whole range of current formulas then inputting this version in the first cell (A106)

    =IFERROR(INDEX(input, SMALL(IF((INDEX(input, ,$O$103, 1)<=$O$101)*(INDEX(input, ,$O$103, 1)>=$O$102), ROW(input)-MIN(ROW(input))+1),ROWS(A$106:A106)),COLUMNS($A106:A106)),"")

    Now confirm with CTRL+SHIFT+ENTER

    ....and only then copy across and down - you should only see one row of data - the rest will be blank
    Audere est facere

  7. #7
    Registered User
    Join Date
    02-21-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Formula with ROWS Function appears not to return correct number of rows

    AMdaddylonglegs

    Thanks so much, it's the first time with array formulae I should have read more before I tried to use them

    regards

    Richard

  8. #8
    Registered User
    Join Date
    02-21-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Formula with ROWS Function appears not to return correct number of rows

    Thanks kevin for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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