+ Reply to Thread
Results 1 to 5 of 5

Array formula

  1. #1
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167

    Question Array formula

    Hello guys...

    I've got a formula in my spreadsheet that is quite lengthy. I could use an array formula to replace this formula...but I don't know how to construct it.

    Below is an example of my current formula:
    Please Login or Register  to view this content.
    The code in my spreadsheet is far longer than this example, as there are considerably more options for each category.

    Attached is a sample workbook containing the example above.
    The worksheet might better explain what I need the array formula to do.
    Attached Files Attached Files
    Last edited by HuskerBronco; 01-10-2010 at 07:50 PM. Reason: Solved

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Array formula

    Try constructing a table of values..

    e.g.

    In R2, enter "Cats", in R3, "Dogs", in R4, "Birds" and in R5, "Fish" (all without quotes)

    Then in S1 to Z1, the numbers 1 to 8 across...

    then in C1, use formula:

    =INDEX($R$1:$Z$5,MATCH(A1,$R$1:$R$5,0),MATCH(B1,$S$1:$Z$1))

    copied down.

    You can add to your table and adjust formula as necessary..

    The formula extracts the intersect of column A and column B values...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167

    Re: Array formula

    Thanks for your speedy reply...NBVC.

    Going to try your suggestion, right now.

  4. #4
    Registered User
    Join Date
    12-27-2009
    Location
    Paris, France
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Array formula

    Hello,

    A lead with a personal function.

    Copy this code in a standard module

    Please Login or Register  to view this content.

    ArrayFormula(Cell1 As Range, Cell2 As Range)
    Cell1 as range of animal's name
    Cell2 as range of number

    Example :
    in A1 Cats, in B1 2 , in C1 =ArrayFormula(A1;B1) => Cats 2

    With regards.

    PMO
    Patrick Morange
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    01-12-2004
    Location
    Nebraska, USA
    MS-Off Ver
    Office 365
    Posts
    167

    Thumbs up Re: Array formula

    Holy Cow, Patrick...!!!

    I don't know how you guys whip this stuff up so quickly.
    I can't completely figure out what your macro is doing...but it works!!!

    I had already incorporated a solution based on NBVC's suggestion into my spreadsheet...but, your solution was begging to be tried.
    With a few modifications...your solution worked flawlessly.

    Excellent, excellent work, guys....!!!

+ 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