+ Reply to Thread
Results 1 to 3 of 3

Sports Example --- return 1st, 2nd, etc. non-zero values in a sequence of rows

  1. #1
    Registered User
    Join Date
    12-29-2015
    Location
    San Francisco
    MS-Off Ver
    Office 2013
    Posts
    1

    Unhappy Sports Example --- return 1st, 2nd, etc. non-zero values in a sequence of rows

    Hey all,

    My first time to the forum, and I had considered myself a bit of an Excel expert, but apparently I am not after seeing all of the outstanding contributions here. Can anyone help me with the following formula I need to write?

    Basically I have a sequence of rows each containing columns ten left-to-right columns of values. In each row, five of the columns contain non-zero numbers (but they could easily be check marks or names of people). What I need to do is return either the column number or the actual value of those five non-zero numbers in an adjacent set of columns.

    Imagine the reference data is a string indicating which of 10 possible players is currently on the floor in a game of basketball (ie five players on the court at all times, remaining five are on the bench). And so there are different five-person permutations, and I will pluck out the unique permutations to look at which lineup combinations scored the best, defended the best, etc.

    I have played with SMALL/ROW and INDEX/MATCH to no avail in this particular case, as most people that I have seen try to solve this problem had their data oriented vertically as opposed to horizontally (I do not unfortunately have the option to flip my data).

    MUCHOS GRACIAS to anyone that can help, have been banging my head against the wall on this one for several hours.

    -AH
    Attached Files Attached Files

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Sports Example --- return 1st, 2nd, etc. non-zero values in a sequence of rows

    In Cell P5

    =IF(COLUMNS($A1:A1)>COUNTIF($E5:$N5,"<>"&0),"",INDEX($E5:$N5,SMALL(INDEX(($E5:$N5<>0)*(COLUMN($E5:$N5)-COLUMN($E5)+1),),COUNTIF($E5:$N5,0)+COLUMNS($A1:A1))))


    Copy down and across
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,215

    Re: Sports Example --- return 1st, 2nd, etc. non-zero values in a sequence of rows

    Try

    =IFERROR(INDEX($E5:$N5,SMALL(IF($E5:$N5>0,COLUMN($E$4:$N$4)-COLUMN($E$4)+1,""),COLUMNS($A:A))),"")

    Enter with Ctrl+Shift+Enter

    Copy across and down

+ 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] Function to return sequence from rank?
    By cocacrave in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-21-2015, 11:22 AM
  2. Replies: 20
    Last Post: 11-27-2014, 02:37 AM
  3. Replies: 2
    Last Post: 02-27-2014, 06:18 AM
  4. Replies: 1
    Last Post: 07-03-2013, 12:14 AM
  5. Replies: 0
    Last Post: 08-25-2012, 12:50 PM
  6. 2 Rows of Values but return one name based on a given value
    By erehwon in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-07-2012, 01:13 AM
  7. return data for last record in sequence by row
    By tinkerbelle in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-23-2010, 09:39 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