+ Reply to Thread
Results 1 to 4 of 4

How to get ARRAY formula to work over two variables from two tables on separate worksheets

  1. #1
    Registered User
    Join Date
    03-29-2006
    Location
    Flathead Lake, Montana
    MS-Off Ver
    2003 and 2010
    Posts
    13

    How to get ARRAY formula to work over two variables from two tables on separate worksheets

    I am having a difficult time trying to avoid a whole bunch of nested IF statements, when I know some form of an Array function would be better and easier.
    Simplifying my example..... let's say that I have seven stores that I am selling/shipping to.
    And lets say that I have five (5) models of stereo receivers that I am selling to them.
    Each of the models of stereo receivers has different features, such as AM/FM, XM, LAN connection and rack mount ability.
    The features of each model of stereo receiver is on worksheet tab MODELS and is:
    Model_lookup_1.JPG
    The features of each model are indicated by a "x", and are blank if that feature is not provided on that model.

    Then the reference table for the Stores and their ordering is on a worksheet tab labeled STORES:
    So this tells me how many of what model receiver each store has ordered.
    Model_lookup_2.JPG

    The first thing I need to know is how many XM antennas to ship to each store.
    So let's start easy enough with just Store #1.
    I need to look at sheet STORES, B2:F2 to see what quantity of what models that Store #1 ordered.
    And I need to reference back to sheet MODELS for each stereo receiver model they have ordered to see if it is equipped with an XM tuner before I can count the number of antennas needed.

    So I start with the first receiver model 1000 in Column B:

    =IF(VLOOKUP(STORES!B1,MODELS!A1:E6,3,FALSE)=1,IF(STORES!B2="",0,STORES!B2),0)

    So I look to see if the Model Number of cell B1 has a check mark in column 3 to indicate that it has XM, if it does, then I check to see if they ordered any.
    If they didn't I count zero, but if they did I count that total number.
    This works fine and gives me the number of XM antennas for the first column.

    What I can't figure out is how to ARRAY across the entire Row of Store #1, while individually checking back for each model number (i.e each column) if that specific model has an XM radio.
    So I end up with a bunch of consecutive IF statements, which is tedious and UGLY and time consuming:
    Here is just adding in the second column:

    =IF(VLOOKUP(STORES!B1,MODELS!A1:E6,3,FALSE)=1,IF(STORES!B2="",0,STORES!B2),0)+IF(VLOOKUP(STORES!C1,MODELS!A1:E6,3,FALSE)=1,IF(STORES!C2="",0,STORES!C2),0)....+IF(for D2)....+IF(for E2)...+IF(for F2)

    Gruesome!
    I had hoped there was some way of making an Array something along the lines of:

    {=IF(VLOOKUP(STORES!B1:F1,MODELS!A1:E6,3,FALSE)=1,IF(STORES!B2:F2="",0,STORES!B2),0)}

    But that doesn't work.
    I've tried INDEX and MATCH, but can't get that to work either.
    So I'm totally at a loss.
    Here was my closest attempt to make that work:

    {=INDEX(MODELS!MODELS!A1:E6,MATCH(STORES!B2,MODELS!A1:E6,0))}

    Then the second part of this is to count all of the total number of XM antennas I am going to need.
    So that takes the Array across the entire table of STORES.
    So one store is Array B2:F2.
    And all stores is Array B2:F6.

    Thank you for the time to at least read this, it's driving me crazy!!!!
    It's got to be relatively straightforward, I just can't seem to figure it out.

    ............ Carleaston

  2. #2
    Registered User
    Join Date
    03-29-2006
    Location
    Flathead Lake, Montana
    MS-Off Ver
    2003 and 2010
    Posts
    13

    Re: How to get ARRAY formula to work over two variables from two tables on separate worksh

    I am not sure if you can view the tables, so I am attaching them here as attachments.

    .............carleaston
    Attached Images Attached Images

  3. #3
    Registered User
    Join Date
    03-29-2006
    Location
    Flathead Lake, Montana
    MS-Off Ver
    2003 and 2010
    Posts
    13

    Re: How to get ARRAY formula to work over two variables from two tables on separate worksh

    Here is the Models table.


    ..........carleaston
    Attached Images Attached Images

  4. #4
    Registered User
    Join Date
    03-29-2006
    Location
    Flathead Lake, Montana
    MS-Off Ver
    2003 and 2010
    Posts
    13

    Re: How to get ARRAY formula to work over two variables from two tables on separate worksh

    hmmmmmmmmmm.......... for some reason my MODELS table isn't showing up.
    Let's try uploading it again.

    ...............carleaston
    Attached Images Attached Images

+ 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. Tables do not work in Protected worksheets
    By Dave@PCT in forum Excel General
    Replies: 4
    Last Post: 10-10-2012, 11:36 AM
  2. Transfer Data to separate tables based two variables (site and product)
    By yunesm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2010, 09:47 PM
  3. Transfer Data to separate tables based two variables (date and site)
    By yunesm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-28-2009, 08:30 PM
  4. Pivot tables and array variables
    By JAdamJ in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2005, 11:30 AM
  5. How to use array formula for three variables?
    By MelissaS in forum Excel General
    Replies: 2
    Last Post: 01-20-2005, 10:06 AM

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