+ Reply to Thread
Results 1 to 11 of 11

Array Functions

Hybrid View

Mars1834 Array Functions 08-03-2015, 03:53 PM
Mars1834 Re: Array Functions 08-03-2015, 04:29 PM
ChemistB Re: Array Functions 08-03-2015, 04:39 PM
Mars1834 Re: Array Functions 08-03-2015, 04:54 PM
ChemistB Re: Array Functions 08-03-2015, 04:43 PM
ChemistB Re: Array Functions 08-03-2015, 05:00 PM
Mars1834 Re: Array Functions 08-03-2015, 05:26 PM
ChemistB Re: Array Functions 08-04-2015, 08:58 AM
ChemistB Re: Array Functions 08-04-2015, 10:54 AM
Mars1834 Re: Array Functions 08-04-2015, 03:42 PM
ChemistB Re: Array Functions 08-04-2015, 03:45 PM
  1. #1
    Registered User
    Join Date
    08-03-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    5

    Array Functions

    Trying to figure out a formula in order to accommodate the following:

    I have a table in which there are a bunch of amplifiers and a bunch of different types of speakers. each amplifiers has enough power to support a certain number of speakers depending on the brand and power size. I need a function that will be able to let me select a type and quantity of speaker, and output the amplifier needing to be used.

    For example.

    ---------Amp1-------Amp2-----Amp3------Amp4
    Sp1------1-3---------4-6--------7-9--------10-12
    Sp2------1-4---------5-7--------8-10-------11-14 <<<---Number of speakers that will fit each amp by column
    Sp3------1-2---------3-5--------6-8---------9-12

    In this model I want to select the speaker type, and the quantity of the speaker, and have a cell tell me which amplifier to use.
    My major problem is that I cant figure out a way to combine all of the Fx's to provide a Row/Column/ and In between statement that will achieve what I need.

    Please Help, Thank you!
    Last edited by Mars1834; 08-03-2015 at 03:55 PM.

  2. #2
    Registered User
    Join Date
    08-03-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    5

    Re: Array Functions

    To clarify, I already have a drop down built to select the speaker type and quantity, I just need a formula that will output the correct amplifier to use based on these parameters.

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

    Re: Array Functions

    See attached. With speaker quantity in C7 and speaker type in C8, and data in B2:E4

    In C9

    =INDEX($B$1:$E$1, MATCH(C7, INDEX($B$2:$E$4, MATCH(C8, Speaker,0),)))
    Attached Files Attached Files
    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
    Registered User
    Join Date
    08-03-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    5

    Re: Array Functions

    This is SO close, appreciate the help, but when I plugged this into my version using the upper limit of each amplifier, it selects the amp above it. This is why i need the in between function I think anyway.

    using the example above

    ---------Amp1-------Amp2-----Amp3------Amp4
    Sp1------1-3---------4-6--------7-9--------10-12
    Sp2------1-4---------5-7--------8-10-------11-14 <<<---Number of speakers that will fit each amp by column
    Sp3------1-2---------3-5--------6-8---------9-12

    say I select speaker 2 and i have 6 of them. I should get and answer of amp2

    However, with the formula you've provided, even though I set it up the same exact way, it will tell me that with 6 speaker 2's I should use amp 1.

    I think that this is because it is set to the upper limit of the amp instead of looking at lower and upper limits. which is why I initially though that I needed an in between function of sorts. I should have mentioned that the upper limit of the amplifier is the MOST amount of speakers allowed on that amp. Meaning that I cant have more than 7 Speaker 2's on amp2.
    Last edited by Mars1834; 08-03-2015 at 05:01 PM.

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

    Re: Array Functions

    Since you do have an upper limit, I added another column with the header "Too Many Speakers" Putting one more than your maximum for each speaker in that column, just expand the range for your data.
    Attached Files Attached Files

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

    Re: Array Functions

    No, What formula are you using?

    If I see your worksheet, I can see your error. (Go Advanced> Manage Attachments)

    Heading out for the night, be back tomorrow
    Last edited by ChemistB; 08-03-2015 at 05:02 PM.

  7. #7
    Registered User
    Join Date
    08-03-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    5

    Re: Array Functions

    Thank you for your help, if you can get this working i will be forever grateful.. I just dont understand why mine is acting different than yours
    Attached Files Attached Files

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

    Re: Array Functions

    The numbers in your tables need to represent minimums. More specifically, they should be 1 more than the maximum of the previous amp. So for Sp1, AMP1 =1, AMP2 = 14, etc.

    I see AMP 6 and 7 have the same max for Speaker 1. My formula will return the higher amp. If you want to be able to return multiple values, we can come up with a more complex formula. Is that preferrible?

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

    Re: Array Functions

    Okay, in this sheet, I put min and max speakers for each amp in separate cells (i.e. Sp1/amp 1 can have 1 to 13, Amp 2 can have 8 to 17, etc.

    In C13, is this ARRAYED formula copied to the right

    =IFERROR(INDEX($B$1:$N$1, SMALL(IF(MOD(COLUMN($B$2:$N$2),2)=0, IF(INDEX($B$2:$N$10, MATCH($A$13, Speaker,0),)<=$B$13, IF(INDEX($C$2:$O$10, MATCH($A$13, Speaker,0),)>=$B$13, COLUMN($B$2:$N$2)-1))),COLUMNS($A$1:A$1))),"")
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    So, with my table, Sp1 and Qty of 20 returns AMP3,4 and 5
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    08-03-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    5

    Thumbs up Re: Array Functions

    This is phenomenal, perfectly executed thank you. I plan to add more things to it which i will take a stab at tonight, for example returning combinations of amps for higher quantities. If i get stuck I will surely ask for your help.

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

    Re: Array Functions

    Glad to help. Thanks for the rep.

+ 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] More about VBA FUNCTIONS AND ARRAY ?
    By hemesh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-06-2014, 02:46 PM
  2. Array from an Array using Index VBA functions
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2013, 09:33 AM
  3. VBA – User Designed Functions (UDF) - Renaming array functions
    By hbsonly in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-03-2013, 02:00 PM
  4. Replies: 1
    Last Post: 02-10-2012, 05:27 PM
  5. using excel array functions on part of array
    By chewwy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2009, 07:19 AM
  6. array functions
    By cashflowpro in forum Excel General
    Replies: 1
    Last Post: 03-05-2008, 01:30 PM
  7. Replies: 2
    Last Post: 07-13-2006, 11:30 PM
  8. Array functions
    By rmellison in forum Excel General
    Replies: 8
    Last Post: 09-09-2005, 05:05 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