+ Reply to Thread
Results 1 to 7 of 7

Excel array formula, offset, index, match...

  1. #1
    Registered User
    Join Date
    03-17-2011
    Location
    hong kong
    MS-Off Ver
    Excel 2003
    Posts
    13

    Excel array formula, offset, index, match...

    Hi, I'm trying to separate several datasets from a long table so I can graph the results.

    Sample spreadsheet attached

    Data is in a table containing a name, date and value

    A; B; C;
    Cris; 01-Oct-10; 52
    Dave; 03-Oct-10; 151
    Ella; 03-Oct-10; 65
    Fred; 08-Oct-10; 98
    Bill; 08-Oct-10; 117
    Cris; 08-Oct-10; 62
    Cris; 15-Oct-10; 54
    Adam; 15-Oct-10; 121


    I have used array formulas to separate out the unique dates and names for the axes of
    the table that will be used for the graph: eg


    .......... Adam; ...Bill; ...Cris; ...Dave; ...Ella; ...Fred
    01-Oct-10 .................. 52
    03-Oct-10 .............................151 ....65
    08-Oct-10 etc etc.... 117 62 98
    15-Oct-10 121


    The bit I'm struggling with is the array formula to populate the table. It needs to reference the date in the left col and the name above and fill in the corresponding cells.

    I expect to use index, match, offset - but I just cant get it to work :-/
    Attached Files Attached Files
    Last edited by NBVC; 03-17-2011 at 01:22 PM.

  2. #2
    Registered User
    Join Date
    03-17-2011
    Location
    hong kong
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Excel array formula, offset, index, match...

    excuse the ........ above - just a vain attempt to align things in columns

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

    Re: Excel array formula, offset, index, match...

    Does this work for you?

    In G22:

    =SUMPRODUCT(--(INT(PlayedDates)=$E22),--(UserNames=G$21),Rating)

    copied across the matrix.
    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.

  4. #4
    Registered User
    Join Date
    03-17-2011
    Location
    hong kong
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Excel array formula, offset, index, match...

    Man you're good. And fast! Thank you!

    I copied the formula across the matrix (as a standard formula, not Ctrl-Shft-Enter) and it works. I can add an IF(..) to get rid of the zero values.

    What I've discovered is that SUNPRODUCT is summing the products (surprise!), which means that if I get two results in for the same person on the same day the score is added together which would put a spike in the graph (eg Adam gets 256 on Oct 18)

    Is there a way to pick only the first, or the highest value if a person has two records on the same day?

    If not I can probably kludge together a VBA routine earlier in the process to run through the list and overwrite duplicates rather than adding them.

    --- Also - what is the -- for in the formula? I've not seen that before.
    Last edited by flippertie; 03-17-2011 at 09:17 AM.

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

    Re: Excel array formula, offset, index, match...

    Sumproduct won't work for that then....

    To get first match, try:

    Please Login or Register  to view this content.
    then you can hide the 0's by formatting the table cells as 0;-0;;@

    The -- in the Sumproduct are coerces that convert arrays of TRUE/FALSE to 1/0 respectively for the math to be performed

  6. #6
    Registered User
    Join Date
    03-17-2011
    Location
    hong kong
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Excel array formula, offset, index, match...

    Thanks again.

    The new formula works - I shall step through it in the formula toolbar in an attempt to understand..

    I used Sumproduct (for the first time) to calculate the number of entries column without the -- coerce - and it worked. I'll have to work on that one as well.

    So much to learn

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

    Re: Excel array formula, offset, index, match...

    Here is a good article on Sumproduct and it's many uses.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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