+ Reply to Thread
Results 1 to 6 of 6

Pivot Help - Matching / Outputting the expected value

  1. #1
    Forum Contributor
    Join Date
    03-19-2016
    Location
    Chicago, IL
    MS-Off Ver
    Office 2016 Professional
    Posts
    388

    Pivot Help - Matching / Outputting the expected value

    I'm trying to match data from Sheet1 (Column H) to Sheet2 (Column A).

    When the values match, output the value in Column K (from Sheet2) to Column M of Sheet1.

    If the values do not match, output a '0'.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Pivot Help - Matching / Outputting the expected value

    Twelve hours to get any sort of a reply. Suggestion: next time, please provide a better explanation or (better still, for really fast answers) attach a sample sheet. Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    However, for this time, this formula should be what you want:

    =IFERROR(VLOOKUP(H2,Sheet2!$A$2:$K$10,11,FALSE),0)

    See sheet.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Pivot Help - Matching / Outputting the expected value

    Suppose all data in row 2 onword.
    In cell "M2"
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Pivot Help - Matching / Outputting the expected value

    Hi. Whole column references in MATCH are NOT a good idea, unless you have 1,000,000-plus rows.... The "" around the 0 are not required, either...

  5. #5
    Forum Contributor
    Join Date
    03-19-2016
    Location
    Chicago, IL
    MS-Off Ver
    Office 2016 Professional
    Posts
    388

    Re: Pivot Help - Matching / Outputting the expected value

    =IFERROR(VLOOKUP(H2,Sheet2!$A$2:$K$10,11,FALSE),0)

    Can you explain what the different parts of this formula mean?

    Specifically, can this portion be explained?

    $K10,11,FALSE

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Pivot Help - Matching / Outputting the expected value

    =IFERROR(VLOOKUP(H2,Sheet2!$A$2:$K$10,11,FALSE),0)

    splits up into:


    =IFERROR(blah blah,0)

    This just means if blah blah results in an error, return zero.

    and

    VLOOKUP(H2,Sheet2!$A$2:$K$10,11,FALSE)

    This means look up the value in H2 in the first column of the range A2 to K10 and return the corresponding value in the 11th column (K).

    the FALSE bit merely means "Look for an exact match".

    You may need to amend the range K10 to suit your actual data. You didn't tell us the range your data covered, nor did you post a sample sheet. So, I made a guess.





    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. Expected table is not in the expected format - ADODB Connection to Read Only Excel file
    By Roshan10043 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2018, 10:54 AM
  2. [SOLVED] Pivot Table filter is not working as expected
    By tuph in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-20-2015, 09:20 PM
  3. outputting pivot table selection to a separate sheet
    By tinkerbelle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-26-2011, 10:18 AM
  4. Matching columns and outputting lists of corresponding values
    By eila90 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-09-2010, 03:18 AM
  5. Matching Two Columns and Outputting a Third
    By jdoe1111 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-24-2010, 03:10 PM
  6. outputting an array
    By demuro1 in forum Excel General
    Replies: 2
    Last Post: 10-05-2008, 09:54 PM
  7. [SOLVED] Pivot Table Wizard Error (Expected 52)
    By Guest in forum Excel General
    Replies: 0
    Last Post: 04-28-2006, 05:15 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