+ Reply to Thread
Results 1 to 8 of 8

Index Match problem

  1. #1
    Registered User
    Join Date
    07-12-2016
    Location
    Mount Olive, Alabama
    MS-Off Ver
    2013
    Posts
    47

    Index Match problem

    Below is my formula (a single formula, I posted like this, so it's easier to read).

    Anyhow, this formula is on several lines and I'm trying to add up data on each time a person does a certain task. The formula is working across all sheets, FEB thru DEC, but JAN is adding the first two lines correctly, and the rest is wrong. It doesn't make sense, because I cut and pasted the same data on all sheets to test the formula. Any ideas?

    =INDEX(Jan!AG3:Jan!AG15,MATCH(A2,Jan!A3:Jan!A15))+
    INDEX(Feb!AG3:Feb!AG15,MATCH(A2,Feb!A3:Feb!A15))+
    INDEX(Mar!AG3:Mar!AG15,MATCH(A2,Mar!A3:Mar!A15))+
    INDEX(Apr!AG3:Apr!AG15,MATCH(A2,Apr!A3:Apr!A15))+
    INDEX(May!AG3:May!AG15,MATCH(A2,May!A3:May!A15))+
    INDEX(Jun!AG3:Jun!AG15,MATCH(A2,Jun!A3:Jun!A15))+
    INDEX(Jul!AG3:Jul!AG15,MATCH(A2,Jul!A3:Jul!A15))+
    INDEX(Aug!AG3:Aug!AG15,MATCH(A2,Aug!A3:Aug!A15))+
    INDEX(Sep!AG3:Sep!AG15,MATCH(A2,Sep!A3:Sep!A15))+
    INDEX(Oct!AG3:Oct!AG15,MATCH(A2,Oct!A3:Oct!A15))+
    INDEX(Nov!AG3:Nov!AG15,MATCH(A2,Nov!A3:Nov!A15))+
    INDEX(Dec!AG3:Dec!AG15,MATCH(A2,Dec!A3:Dec!A15))

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Index Match problem

    If you create a list of all sheets, and give that list a range name (say - sheetnames), you could use something like this...
    '=SUMPRODUCT(SUMIF(INDIRECT("'"&sheetnames&"'!A3:A15"),A2,INDIRECT("'"&sheetnames&"'!AG3:AG15")))

    If that doesnt work for you, upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,826

    Re: Index Match problem

    If I may -- exactly what is this formula trying to do (other than add up the same type of value from each monthly tab)? You can do as Ford suggests, but summarizing monthly data feels like more of a database/pivot table type operation. Ultimately it is up to you to decide. If your task can be represented by a pivot table based on a database of data, then I would suggest you abandon the multiple monthly tabs thing and build a solid database and use that as a source for a pivot table. See this recent discussion along with the links in post #2: https://www.excelforum.com/excel-new...ta-layout.html
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Index Match problem

    Actually, MrShorty makes a very good point, that I totally overlooked - putting ALL your data on ONE sheet, and running summaries from that

  5. #5
    Registered User
    Join Date
    07-12-2016
    Location
    Mount Olive, Alabama
    MS-Off Ver
    2013
    Posts
    47

    Re: Index Match problem

    Quote Originally Posted by FDibbins View Post
    If you create a list of all sheets, and give that list a range name (say - sheetnames), you could use something like this...
    '=SUMPRODUCT(SUMIF(INDIRECT("'"&sheetnames&"'!A3:A15"),A2,INDIRECT("'"&sheetnames&"'!AG3:AG15")))

    If that doesnt work for you, upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    I realized part of my problem was I forgot the dollar signs.

    Anyhow, I got most of it working, and greatly simplified the sheet by having the total page show month by month.

    But, two of the names are not adding correctly. The lines for Singleton show 4 (should be 2) and Forman show 1 (should be 4) and my overall total shows 14, but should be 15.

    I attached the sheet. Thank you for your help.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-12-2016
    Location
    Mount Olive, Alabama
    MS-Off Ver
    2013
    Posts
    47

    Re: Index Match problem

    Any ideas?

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Index Match problem

    Try INDIRECT to refer to month title in row 1 automatically:
    In B2:
    Please Login or Register  to view this content.
    Drag down and accross.
    Quang PT

  8. #8
    Registered User
    Join Date
    07-12-2016
    Location
    Mount Olive, Alabama
    MS-Off Ver
    2013
    Posts
    47

    Re: Index Match problem

    Quote Originally Posted by bebo021999 View Post
    Try INDIRECT to refer to month title in row 1 automatically:
    In B2:
    Please Login or Register  to view this content.
    Drag down and accross.
    I've never used the INDIRECT function, but it worked perfect.

    Thanks!

+ 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. Formatting with INDEX MATCH MATCH Problem
    By SwissExcel in forum Excel General
    Replies: 1
    Last Post: 07-22-2015, 07:40 AM
  2. [SOLVED] Index Match Match - syntax problem
    By Dabooka in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-01-2014, 09:05 AM
  3. INDEX(MATCH) Problem
    By strangedenial in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2014, 08:21 AM
  4. Replies: 6
    Last Post: 05-28-2013, 05:08 PM
  5. Index,Match problem...
    By kmc500 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-07-2012, 10:45 AM
  6. Problem with INDEX, INDIRECT, MATCH, MATCH
    By JO505 in forum Excel General
    Replies: 5
    Last Post: 09-01-2011, 05:51 PM
  7. Index match problem getting #N/A
    By mugs62 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-27-2009, 05:18 PM

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