+ Reply to Thread
Results 1 to 4 of 4

Solved: Index Function with Multiple "Ifs" won't Return More than First Result

  1. #1
    Registered User
    Join Date
    08-06-2014
    Location
    Redmond, WA, USA
    MS-Off Ver
    MS Office 2010 & MAC MS Office 2007
    Posts
    2

    Solved: Index Function with Multiple "Ifs" won't Return More than First Result

    Hi,

    I am attempting to get an INDEX function with multiple "IF" statements to return more than one result. I've scanned through previous posts and found some help wtih building the multiple IF statements. That portion of the below formula works. However, I can only get the INDEX formula to return the first, single result.

    Formula:
    =IFERROR(INDEX(Func_Area,SMALL(IF(Const_Start<=DATE(YEAR($B$2),MONTH($B$2),DAY($B$2)), IF(Cost_End>=DATE(YEAR($C$2),MONTH($C$2),DAY($C$2)),ROW(Func_Area)-MIN(ROW(Func_Area))+1,"")),ROWS($A$4:A4)))," ")

    Func_Area,Const_Start,Cost_End are all Named Ranges on Sheet "Proposed". My intention is to return a list of projects on Sheet Test1 for all projects starting construction after a certain date and completing construction before a certain date. I suspect something in my ROWS fuction or ROW-MIN+1 is wrong.

    This formula returns the first result in the first row, but every subsequent row is blank...see attached spreadsheet.

    What am I missing?
    Attached Files Attached Files
    Last edited by Probert; 08-11-2014 at 05:24 PM. Reason: SOLVED!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Index Function with Multiple "Ifs" won't Return More than First Result

    Given your stated aim you should be using Data Filtering functionality rather than using specific functions like INDEX.

    Try Data Advanced Filter and specify an output range and a criteria range that uses your two dates.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

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

    Re: Index Function with Multiple "Ifs" won't Return More than First Result

    I think you need to reverse the > and < signs if you want projects that start on or after 1/1/2014 and end on or before 31/12/2014. Try this formula in A4

    =IFERROR(INDEX(Func_Area,SMALL(IF(Const_Start>=$B$2, IF(Cost_End<=$C$2,ROW(Func_Area)-MIN(ROW(Func_Area))+1)),ROWS(A$4:A4))),"")

    confirm with CTRL+SHIFT+ENTER and copy down

    ......then copy across and change the INDEX range for each column
    Last edited by daddylonglegs; 08-11-2014 at 05:06 PM.
    Audere est facere

  4. #4
    Registered User
    Join Date
    08-06-2014
    Location
    Redmond, WA, USA
    MS-Off Ver
    MS Office 2010 & MAC MS Office 2007
    Posts
    2

    Re: Index Function with Multiple "Ifs" won't Return More than First Result

    Beautiful! Thank you daddylonglegs. I ended up keeping the < > arrows as I had them, but the more simplistic version of the formula worked much better!

+ 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. [SOLVED] INDEX MATCH - To return all rows based on multiple conditions ("",SetA)
    By Dahlia in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-17-2014, 05:10 AM
  2. [SOLVED] Return "0" result when index location does not exist
    By trevasta in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-23-2013, 02:34 AM
  3. Replies: 9
    Last Post: 09-05-2012, 10:23 AM
  4. [SOLVED] Variable "sheet-name" and "range-name" wanted in INDEX/MATCH-function
    By Fiebuls in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-01-2012, 04:09 PM
  5. [SOLVED] Find multiple "text" criteria and return as ""Yes" in Matrix
    By bertrand82 in forum Excel General
    Replies: 11
    Last Post: 04-30-2012, 09: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