+ Reply to Thread
Results 1 to 14 of 14

Array Formula Help w/ Excel Workbook Example

Hybrid View

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

    Re: Array Formula Help w/ Excel Workbook Example

    Here is another slightly easier to follow alternative (No offense, ChemistB!), again entered into the entire column at the same time then copied across:


    =IFERROR(INDEX($A$3:$A$30,IFERROR(SMALL(IFERROR(--CONCATENATE(IFERROR(1/--(E2=$B$3:$B$30)*ROW(1:30),""),IFERROR(1/--(E2=$C$3:$C$30)*ROW(1:30),"")),""),ROW(1:30)),"")),"")


    Formula edited, i had the references off slightly.
    Last edited by Speshul; 09-15-2014 at 10:38 AM.
    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.

  2. #2
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Array Formula Help w/ Excel Workbook Example

    The only change I would make in your formula is D2 to E2 (to reference cell E3 for the array), otherwise this works too

  3. #3
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Array Formula Help w/ Excel Workbook Example

    Quote Originally Posted by Speshul View Post
    Here is another slightly easier to follow alternative (No offense, ChemistB!), again entered into the entire column at the same time then copied across:


    =IFERROR(INDEX($A$3:$A$30,IFERROR(SMALL(IFERROR(--CONCATENATE(IFERROR(1/--(E2=$B$3:$B$30)*ROW(1:30),""),IFERROR(1/--(E2=$C$3:$C$30)*ROW(1:30),"")),""),ROW(1:30)),"")),"")


    Formula edited, i had the references off slightly.
    Speshul,

    Would you be able to further explain how the ROW(1:30) function in your formula works?

    I'm trying to make appropriate changes to apply this to my master workbook, and I'm assuming the reason it is not working for me is because of the ROW function having a wrong reference when I try to change it.

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

    Re: Array Formula Help w/ Excel Workbook Example

    Quote Originally Posted by mcmahobt View Post
    Speshul,

    Would you be able to further explain how the ROW(1:30) function in your formula works?

    I'm trying to make appropriate changes to apply this to my master workbook, and I'm assuming the reason it is not working for me is because of the ROW function having a wrong reference when I try to change it.
    The ROW(1:30) effectively increases by 1 per row it is placed on. This formula uses it to get the k value of the small formula. So, starting from the top formula, it returns a 1, the second formula, it is a 2. Giving you the Smallest, then Second smallest, then Third smallest, and so on. The 1:30 is just stating how high to count. It is arbitrary as long as the number is higher than the data that will be needed, since the example had 27 rows, I just picked 30.

    If you use the function =ROW() and drag it down, you will be returned with the row number the formula is placed on.

    If you define the row number, =ROW(1:10) and copy it down, you will get 1, 2, 3, 4, 5....and so on regardless of where the formula is placed. If you EXCEED the number of rows (10 in this example) you will get #N/A errors. So if you get getting errors using the formula in a larger area than the 30 allowed for by the ROW function, that is likely why.

    What you could do is change the formula to
    =IFERROR(INDEX($A$3:$A$30,IFERROR(SMALL(IFERROR(--CONCATENATE(IFERROR(1/--(E2=$B$3:$B$30)*ROW()-X,""),IFERROR(1/--(E2=$C$3:$C$30)*ROW()-X,"")),""),ROW()-X),"")),"")

    Where X is the row number ABOVE the first row of the formula. So then , if it is on Row 20, the formula is =ROW()-19, which = 1, or the first smallest number. If the formula starts on row 1, you simply need to use =ROW()

    Otherwise, you can change it to anything larger than the number of rows you will be using. ROW(1:100000) would even work! (I think!)




    As a note, a formula like ChrmistB's solution, which is entered into one cell and copied, would likely use ROWS($A$1:A1). The ROWS function counts the number of rows within the defined range, so $A$1:A1 would be one row, and when you copy it since the first part is locked, it becomes $A$1:A2, counting for two rows.

    This type of count wouldn't work in my formula because every cell would return a one, or ROWS($A$1:A1).
    Last edited by Speshul; 09-15-2014 at 02:19 PM.

  5. #5
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Array Formula Help w/ Excel Workbook Example

    Speshul,

    That definitely makes more sense now. The problem you described with the #N/A results was, in fact, due to exceeding row values, so thanks for the help. In case you were interested in another way as well, user Vikas Gautam also replied to this thread with the formula: =IFERROR(INDEX($A$3:$A$30,SMALL(IF(VALUE(CONCATENATE(--(E$2=$B$3:$B$30),--(E$2=$C$3:$C$30))),ROW($3:$30)-2),ROWS($1:1))),"") which also works, but I'm not sure if his comment showed up properly in the thread.

+ 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. Populate array dynamimically from a different Excel workbook
    By Bruce Tjosvold in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-27-2012, 05:46 PM
  2. Replies: 0
    Last Post: 03-19-2012, 07:32 PM
  3. Array formula referencing another workbook
    By lc130 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-01-2010, 04:47 PM
  4. Array Formula looking at a seperate workbook won't update
    By shockeroo in forum Excel General
    Replies: 10
    Last Post: 04-20-2009, 12:16 PM
  5. [SOLVED] select variables ranges, copy to array, paste the array in new workbook
    By Mathew in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-01-2005, 05:06 AM

Tags for this Thread

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