+ Reply to Thread
Results 1 to 7 of 7

Resuts depending on the criteria

  1. #1
    Forum Contributor
    Join Date
    09-15-2012
    Location
    las vegas
    MS-Off Ver
    excel 2007
    Posts
    147

    Resuts depending on the criteria

    I'm looking for a function that spits out a row given the criteria.

    I have a table containing information. I want a function that when I use two specific criteria, the function will give out the results (i.e. all informaiton contain in one row).

    Please see the attached spreadsheet.
    Attached Files Attached Files
    Last edited by managingcrap; 08-20-2014 at 01:00 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: results depending on a set of criteria

    Use this Array Formula in cell B14. Make sure you hold Control + Shift then press Enter to enter the formula as an array. You will see {}'s around the formula if this is done correctly.

    =INDEX(B3:B7,SUM(($B$10=$C$3:$C$7)*($B$11=$F$3:$F$7)*ROW($1:$5)))


    For the Date, which is F14, use this to convert the serial number to the correct date
    =TEXT(INDEX(F3:F7,SUM(($B$10=$C$3:$C$7)*($B$11=$F$3:$F$7)*ROW($1:$5))),"mm/dd/yyyy")



    For a larger set of data, all you need to modify is the Bold part here; Change the 5 to how many rows there are.
    =INDEX(B3:B7,SUM(($B$10=$C$3:$C$7)*($B$11=$F$3:$F$7)*ROW($1:$5)))
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: results depending on a set of criteria

    Why not just a filter on the criteria.

    See the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  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: Resuts depending on the criteria

    Try this array formula** entered in B14:

    =INDEX($B3:$G7,MATCH(1,($C3:$C7=$B10)*($F3:$F7=$B11),0),COLUMNS($B14:B14))

    ** 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 across to G14.

    Format F14 as Date.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Resuts depending on the criteria

    sorry forgot about the second criteria... use Tony's solution.
    Last edited by simarui; 08-15-2014 at 02:41 PM. Reason: i forgot to include two criteria

  6. #6
    Forum Contributor
    Join Date
    09-15-2012
    Location
    las vegas
    MS-Off Ver
    excel 2007
    Posts
    147

    Re: Resuts depending on the criteria

    Quote Originally Posted by Tony Valko View Post
    Try this array formula** entered in B14:

    =INDEX($B3:$G7,MATCH(1,($C3:$C7=$B10)*($F3:$F7=$B11),0),COLUMNS($B14:B14))

    ** 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 across to G14.

    Format F14 as Date.
    Can you please tell me what this function does? Ty

    MATCH(1,($C3:$C7=$B10)*($F3:$F7=$B11),0)

  7. #7
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Resuts depending on the criteria

    c3:c7=b10 and f3:f7=b11 return an array of "true"s or "false"s ... i.e. {true,false,true,true,false}*{false,false,true,false,true}. the * acts as a binary and(), so you get {1*0=0,0*0=0,1*1=1,1*0=0,0*1=0}

    the match is then looking through the resulting array for a 1... so carrying out my example here it would look for 1 in {0,0,1,0,0} and return the number 3.

+ 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] False negative resuts from Exact formula
    By Melissa Camp in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-05-2014, 10:37 PM
  2. [SOLVED] code that will agregate number of good and bad resuts per user on a different sheet
    By erkamu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-05-2014, 03:54 AM
  3. Copy formula resuts greater than 1 paste unique Records
    By Nunzio in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-17-2011, 09:47 PM
  4. Y or N depending upon age and date criteria
    By mickjjuk in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-10-2011, 11:02 AM
  5. look/match to return resuts from multiple rows
    By martindwilson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-06-2007, 05:59 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