+ Reply to Thread
Results 1 to 13 of 13

Index & Match query

  1. #1
    Registered User
    Join Date
    10-31-2006
    Posts
    19

    Index & Match query

    Hi All,

    i've been struggling with this for a while now and have conceeded defeat. Here's the problem in a nut shell.

    I have a Pivot table listing months across the top and makes of vehicle down the side.


    MAKE Feb Mar

    ALFA
    AUDI 2
    BMW 4
    CHRY
    CITR 1




    Staff have the option on a seperate sheet to select a date and a make and it should return a series of values (there are about 12 tables in total) on a form.
    The trouble is it is returning incorrect values or N/A. Here is how i'm trying to do it.

    FORMULA.

    =INDEX('PIVOT DATA'!A42:O76,MATCH(B25,'PIVOT DATA'!A42:O42,0),MATCH(B26,'PIVOT DATA'!A42:A76,0))

    Any help would be great.

    Thanks.

  2. #2
    pinmaster
    Guest
    Hi, try this:

    =INDEX('PIVOT DATA'!B43:O76,MATCH(B26,'PIVOT DATA'!A42:A76,0),MATCH(B25,'PIVOT DATA'!A42:O42,0))

    do not use row and column headers in your search table:

    B43:O76 instead of A42:O76


    Hope this helps!

    Jean-Guy

  3. #3
    Registered User
    Join Date
    10-31-2006
    Posts
    19
    thanks for the attempt but unfortunatly that doesn't resolve the problem. Is there just a problem using index & match in Pivot Tables?

    I need to include column A as that's the column that has the makes listed in it. Tell me if i'm missing something here. But i thought to look something up you had to have a matching value.

  4. #4
    pinmaster
    Guest
    Hi,

    The formula I gave you should have worked. Maybe it's a format problem, one set of dates could be simple text and the other actual dates formatted as months. Check that out and it that is not the case then maybe you could post a sample sheet to look at. I'm not an expert but I'm sure someone in here can help you.

    Regards
    Jean-Guy

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Can you give an example of what you're putting in B25 and B26, is one formatted as a date?

  6. #6
    Registered User
    Join Date
    10-31-2006
    Posts
    19
    Good morning,

    i can send an example through if i ever work out how to attch a spread sheet to a post.

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    If you can't zip it then you can upkload to either of these sites and atatched the link to your reply

    http://www.savefile.com/

    or


    http://cjoint.com/

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  8. #8
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481
    Zip it, zip it good

    For info on zipping here's a link

    http://service1.symantec.com/SUPPORT...955?Open&src=w

    once you have zipped the example, click on the attatch icon, then select browse then select the zipped file and upload

  9. #9
    Registered User
    Join Date
    10-31-2006
    Posts
    19
    BINGO!

    Here is an exampe of what i was trying to explain, it edited down but you should get the right idea. Thanks for any help you can offer.
    Attached Files Attached Files

  10. #10
    pinmaster
    Guest
    Hi

    As I suspected you were trying to match text "G6" with actual dates formatted as months "PIVOT DATA!B5:L5."

    try this:

    =INDEX('PIVOT DATA'!B7:M37,MATCH(G5,'PIVOT DATA'!A7:A37,0),MATCH(G20,'PIVOT DATA'!B5:M5,0))

    also I would change B51 and B64 to "Grand Total" to get a match when "All" is selected in G6 or G5

    Hope this helps!

    Regards
    Jean-Guy

  11. #11
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Your problem is your validation is a not a date but your pivot is.

    Attached shows you it working if you reference a date. (cells in yellow)

    VBA Noob
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    10-31-2006
    Posts
    19
    Cheers Guys,

    That was causing me all sorts of problems.


    Thanks Again.

  13. #13
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Glad you got there in the end

    VBA Noob

+ 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