+ Reply to Thread
Results 1 to 13 of 13

Issue with returning proper row number using =Small Function

  1. #1
    Registered User
    Join Date
    02-25-2013
    Location
    Cublicles as far as the eye can see.
    MS-Off Ver
    Excel 2007
    Posts
    19

    Issue with returning proper row number using =Small Function

    Hello,

    I've hit a roadblock. I'm trying to use the =Small function to retrieve a number of results to populate a column. However there are multiple criteria. I tried following the MS office tutorial here: http://office.microsoft.com/en-us/ex...001226038.aspx

    It helped somewhat, but I'm having a hard time finding out why it isn't working.

    Here is my single variable formula: =SMALL(IF(Indoor_Make=$C&86,ROW(Indoor_Make)),ROW(1:1)) +shift +enter Where "Indoor_Make" is an array that is 1 column on a separate sheet.
    The above formula is pasted down a blank column until I get an error.

    Here is my double variable formula: =SMALL(IF(COUNTIFS($C$86,Indoor_Make,$D$86,Indoor_Zone),ROW(Indoor_Make)),ROW(1:1)) +shift +enter Where "Indoor_Make" and "Indoor_Zone" are both arrays that are columns on another sheet.
    The above formula is pasted down a blank column until I get an error

    Both of the above work in returning the correct row numbers for the criteria when compared with the data on the separate sheet. The double variable formula works, and returns the row numbers that match both criteria.

    Here's where I run into a problem. I try using the tutorial's formula for displaying the data in the matching rows
    Here is my formula: =INDEX('Indoor Unit Details'!$A$1:$R$500,SMALL(IF(COUNTIFS(Indoor_Make,Dashboard!$C$86,Indoor_Zone,Dashboard!$D$86),ROW(Indoor_Make)),ROW(1:1)),3) +shift +enter Where 'Indoor Unit Details'!$A$1:$R$500 is the table I'm referencing on the separate sheet and I want to return the results in Column 3 that match the rows that fit both criteria.

    The problem is, it isn't working. It displays what is in column 3, but it ignores the criteria and just displays everything. What am I doing wrong?

    Many Thanks and Best Regards,

    Sard
    Last edited by Sardaukar; 04-12-2013 at 11:27 PM.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Issue with returning proper row number using =Small Function

    Quote Originally Posted by Sardaukar View Post
    Here is my formula:

    =INDEX('Indoor Unit Details'!$A$1:$R$500,SMALL(IF(COUNTIFS(Indoor_Make,Dashboard!$C$86,Indoor_Zone,Dashboard!$D$86),ROW(Indoor_Make)),ROW(1:1)),3)

    +shift +enter
    The correct key combination to array enter a formula is CTRL + SHIFT + ENTER.

    What is the cell address of the first cell the formula is entered in? We will use that cell addrsss to replace this expression:

    ROW(1:1)

    Using ROW(1:1) leaves the formula vulnerable to new row insertions which can lead to incorrect results.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    02-25-2013
    Location
    Cublicles as far as the eye can see.
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Issue with returning proper row number using =Small Function

    Yeah, sorry, control shift enter.

    The cell address of the first cell the formula is entered in? Wouldn't that be its own cell? The first cell I'm entering the formula into is F157.

    How do you replace the ROW(1:1) expression? ROW(F157) or just F157?

    Thanks for the help!

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Issue with returning proper row number using =Small Function

    Quote Originally Posted by Sardaukar View Post
    How do you replace the ROW(1:1) expression? ROW(F157) or just F157?
    Like this...

    Array entered** in cell F157:

    =INDEX('Indoor Unit Details'!C:C,SMALL(IF(COUNTIFS(Indoor_Make,Dashboard!$C$86,Indoor_Zone,Dashboard!$D$86),ROW(Indoor_Make)),ROWS(F$157:F157)))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER

  5. #5
    Registered User
    Join Date
    02-25-2013
    Location
    Cublicles as far as the eye can see.
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Issue with returning proper row number using =Small Function

    Okay,

    I followed it exactly. I still get the same problem. It returns the data for every row in that column. No matter how far I drag it down, it basically copies the C column from sheet "Indoor Unit Details"

    I'm going to to put together an excel sheet that gets rid of a lot of confidential stuff and just focuses on this part and attach it.

  6. #6
    Registered User
    Join Date
    02-25-2013
    Location
    Cublicles as far as the eye can see.
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Issue with returning proper row number using =Small Function

    Okay, here it is. But now your formula isn't working. hmm.

    Attached is the workbook.
    Attached Files Attached Files

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Issue with returning proper row number using =Small Function

    The problem is that your named ranges:

    Indoor_Make
    Indoor_Zone

    Refer to an external file: AC Workbook.xlsx

    It doesn't look like you want to reference an external file. It looks to me like you're wanting to extract data (BTU/h) from the Indoor Unit Details sheet for the Make and Multizone entered on the Dashboard sheet.

    Is that correct?

  8. #8
    Registered User
    Join Date
    02-25-2013
    Location
    Cublicles as far as the eye can see.
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Issue with returning proper row number using =Small Function

    That's exactly it. I was planning on a dynamic column of results based on those two variables so I could create a drop down data validation list from the results.

  9. #9
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Issue with returning proper row number using =Small Function

    hi Sardaukar. first, press CTRL + F3 & adjust the 2 Named Range. it's now reading from another file called "AC Workbook" instead of the existing one. so remove everything in the formula in red. mine is something like that, yours would be different:
    'C:\Users\Admin\Downloads\[AC Workbook.xlsx]Indoor Unit Details'!$A$2:$A$500

    then change your range of either one of them. they are supposed to reference the same number of rows:
    'Indoor Unit Details'!$A$2:$A$500
    'Indoor Unit Details'!$F$2:$F$507

    C21 & below are also not supposed to appear, so maybe:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by benishiryo; 04-12-2013 at 09:55 PM.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Issue with returning proper row number using =Small Function

    OK, try it like this...

    If you want the BTU/h data...

    On the Dashboard sheet add the column header BTU/h in cell C1.

    Then, enter this array formula in C2:

    =IFERROR(INDEX('Indoor Unit Details'!C:C,SMALL(IF('Indoor Unit Details'!A$2:A$85=A$2,IF('Indoor Unit Details'!F$2:F$85=B$2,ROW('Indoor Unit Details'!F$2:F$85))),ROWS(C$2:C2))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.

    There are many duplicates there with no other identifying data so I'm guessing you want additional data to be returned?

  11. #11
    Registered User
    Join Date
    02-25-2013
    Location
    Cublicles as far as the eye can see.
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Issue with returning proper row number using =Small Function

    Haha I can't believe I didn't see that. 'doh! I had to get away from the 'puter for a moment
    To hit the gym. When I get back to the office I'll let you know how it works for me!

    Many thanks in advance. Two words... Life saver.

  12. #12
    Registered User
    Join Date
    02-25-2013
    Location
    Cublicles as far as the eye can see.
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Issue with returning proper row number using =Small Function

    Quote Originally Posted by Tony Valko View Post
    OK, try it like this...

    If you want the BTU/h data...

    On the Dashboard sheet add the column header BTU/h in cell C1.

    Then, enter this array formula in C2:

    =IFERROR(INDEX('Indoor Unit Details'!C:C,SMALL(IF('Indoor Unit Details'!A$2:A$85=A$2,IF('Indoor Unit Details'!F$2:F$85=B$2,ROW('Indoor Unit Details'!F$2:F$85))),ROWS(C$2:C2))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.

    There are many duplicates there with no other identifying data so I'm guessing you want additional data to be returned?
    That worked! Oh man that's good. What a relief. For the longest time I was determined to do it myself, but ran into the limit of my excel knowlege. So here I am.

    Many thanks!

  13. #13
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Issue with returning proper row number using =Small Function

    You're welcome. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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