+ Reply to Thread
Results 1 to 11 of 11

Return an array based on condition

Hybrid View

ecelaras Return an array based on... 11-23-2012, 09:06 AM
Fotis1991 Re: Return an array based on... 11-23-2012, 09:20 AM
RHCPgergo Re: Return an array based on... 11-23-2012, 09:21 AM
Fotis1991 Re: Return an array based on... 11-23-2012, 09:32 AM
ecelaras Re: Return an array based on... 11-23-2012, 09:40 AM
Fotis1991 Re: Return an array based on... 11-23-2012, 09:43 AM
ecelaras Re: Return an array based on... 11-23-2012, 09:59 AM
ecelaras Re: Return an array based on... 11-23-2012, 10:16 AM
ecelaras Re: Return an array based on... 11-23-2012, 10:22 AM
Fotis1991 Re: Return an array based on... 11-23-2012, 10:40 AM
Fotis1991 Re: Return an array based on... 11-23-2012, 11:01 AM
  1. #1
    Registered User
    Join Date
    09-16-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    87

    Return an array based on condition

    Hello!!! Need some Help plz,

    I have the table bellow

    data1 date1 20
    data2 date2 -35
    data3 date3 35
    data4 date4 10
    data5 date5 20
    data6 date6 30
    data7 date7 50

    If the values in column 3 is greater than 20 I would like to return the hole array in a different array ,the problem is when i have many arrays with that condition . I would Like all of them to be returned the
    one below the other .

    Thank you

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Return an array based on condition

    Καλησπέρα πατρίδα!

    What you mean when you say "array"? range?

    Can you upload a small sample workbook?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: Return an array based on condition

    Hi,

    you can use a custom filter, where you filter column 3 with the condition of > 20. After that you can copy the filtered range.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Return an array based on condition

    OR, first try this ARRAY formula.

    =IFERROR(INDEX(Sheet1!A$1:A$10;SMALL(IF(Sheet1!$C$1:$C$10>20;ROW(Sheet1!$A$1:$A$10));ROW(Sheet1!A1)));"")

    Copy down and across.

    Edit: For other users

    In Greece, we use semi colons as separators. So you need to change all semi colons in my formula to comma!

  5. #5
    Registered User
    Join Date
    09-16-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Return an array based on condition

    Eyxaristw Foti Lew na to afhsw opws einai

    Thank you all for the quick reply

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Return an array based on condition

    ..Eyxaristw Foti Lew na to afhsw opws einai
    Translate: Thanks Fotis, i"ll let it as it is.

    Welcome.

    You know better than us

  7. #7
    Registered User
    Join Date
    09-16-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Return an array based on condition

    Sorry how can I attach a file?

  8. #8
    Registered User
    Join Date
    09-16-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Return an array based on condition

    Please take a look at this spreadsheet
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-16-2012
    Location
    Greece
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Return an array based on condition

    This one is the corrextCopy of Book1566.xlsx

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Return an array based on condition

    As i said, in A21 this ARRAY(control+shift+enter)-not just enter, formula.

    Copy down and across.

    =IFERROR(INDEX(Sheet1!A$1:A$16;SMALL(IF(Sheet1!$G$1:$G$16>20;ROW(Sheet1!A$1:A$16));ROW(Sheet1!A1)));"")

    You have no value in column G >20, so you get an empty table!!!!!

  11. #11
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Return an array based on condition

    Thanks for the reb*

    If this means that my suggestion works for you, pls mark your thread as solved.

+ 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