+ Reply to Thread
Results 1 to 14 of 14

Array Formula Help w/ Excel Workbook Example

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

    Array Formula Help w/ Excel Workbook Example

    Hello all,

    I am creating a scheduling workbook that I would appreciate some help on if anyone can provide. The current array formula I have is pulling from one set of data, but I would like for it to pull from two sets if possible.

    I have attached a workbook with an example of the array formulas I am using, along with the generic setup, as I think this is a better way of explaining my problem rather than trying to write it out.

    If it is still not clear what I am trying to accomplish, or if anyone has any questions in general, please let me know.

    Thanks in advance for any and all help!
    Attached Files Attached Files

  2. #2
    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's one way. It returns "Product 4/FY 20". I modified how your array formula works

    Select all of an FY column, (in the sample, select E3 through E30) and use Control + Shift + Enter to enter this Array Formula. Copy entire column of formulas through the rest of the columns as needed.

    =IFERROR(INDEX($A$3:$A$30,SMALL(IFERROR(1/(E$2=$B$3:$B$30)*ROW()+1,""),ROW(1:100))-3)&"/"&INDEX($C$3:$C$30,SMALL(IFERROR(1/(E$2=$B$3:$B$30)*ROW()+1,""),ROW(1:100))-3),"")

    I am not sure if that is what you needed, let me know
    Last edited by Speshul; 09-15-2014 at 09:31 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.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Array Formula Help w/ Excel Workbook Example

    Interpreting your request differently, this is messy but it works
    (entered as an array)
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by ChemistB; 09-15-2014 at 10:21 AM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    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,

    I appreciate the help, but that isn't quite what I'm looking for. I re-attached the example, but changed the raw data beneath Opportunities for Improvement and how I hope to have them show up in the schedule cells E3:T30. I'm trying to do the exact same array formula with the Opportunities for Improvement column that was done in the Next Upgrade column, but combined into one formula, so that it will check both the Next Upgrade and Opportunities for Improvement columns, but return a single array. Hopefully this is a little more clear - sorry if there was any confusion!
    Attached Files Attached Files

  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

    Quote Originally Posted by ChemistB View Post
    Interpreting your request differently, this is messy but it works

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    ChemistB!

    You are the man (or woman)! This is exactly what I needed. The formula definitely does look like a bear to get through, but I can disect it and hopefully learn how it works for myself when applying it to my master spreadsheet. Thanks a bunch for the help!

  6. #6
    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

    I believe ChemistB's solution does just that, see the post above your last


  7. #7
    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.

  8. #8
    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

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Array Formula Help w/ Excel Workbook Example

    No offense taken. I often take the long road to get to a solution.

    And if you modify your formula slightly (locking in references and change the final ROW(1:30) to ROWS($1:1), you can enter it as an array in E3 and then drag down and right instead of the need for multiple cell array.

    =IFERROR(INDEX($A$3:$A$30,IFERROR(SMALL(IFERROR(--CONCATENATE(IFERROR(1/--(E$2=$B$3:$B$30)*ROW($1:$30),""),IFERROR(1/--(E$2=$C$3:$C$30)*ROW($1:$30),"")),""),ROWS($1:1)),"")),"")
    Last edited by ChemistB; 09-15-2014 at 11:01 AM.

  10. #10
    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.

  11. #11
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Thumbs up Re: Array Formula Help w/ Excel Workbook Example

    More Condensed formula.. ( Inspired from Sir ChemistB )
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Thank you ChemistB for letting us know such a beautiful construction...
    check the attached file...
    Attached Files Attached Files
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  12. #12
    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.

  13. #13
    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.

  14. #14
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Array Formula Help w/ Excel Workbook Example

    Thanks for reputation points, Mcmahobt
    I have just shortened it..
    Its chemistb who should be honored for this formula..

+ 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. 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