+ Reply to Thread
Results 1 to 2 of 2

Return Values in of Cells in a Column where Two Other Values in Corr. Rows Match Criteria

  1. #1
    Registered User
    Join Date
    05-12-2013
    Location
    NY
    MS-Off Ver
    Excel 2010
    Posts
    3

    Return Values in of Cells in a Column where Two Other Values in Corr. Rows Match Criteria

    Apologies for the confusing post title. I am returning the value in column B of the row in Master (worksheet) where the values of columns A and H or A and G match those of columns R and O or R and N in Usage Staging (worksheet), respectively, to column S of Usage Staging using the following array formula (relevant part in blue):

    {=IF($R2="","",IF($R2="Member Not in PS","Member Not in Master",IF(VLOOKUP($R2,'Master'!$A$2:$J$20000,2,FALSE)="","No Company Name",IF(P2="USA",IF(ISERROR(INDEX('Master'!$B$2:$B$20000,MATCH('Usage Staging'!$R2&'Usage Staging'!$O2,'Master'!$A$2:$A$20000&'Master'!$H$2:$H$20000,0))),"No Exact Member ID & State Pair Match",INDEX('Master'!$B$2:$B$20000,MATCH('Usage Staging'!$R2&'Usage Staging'!$O2,'Master'!$A$2:$A$20000&'Master'!$H$2:$H$20000,0))),IF(ISERROR(INDEX('Master'!$B$2:$B$20000,MATCH('Usage Staging'!$R2&'Usage Staging'!$N2,'Master'!$A$2:$A$20000&'Master'!$G$2:$G$20000,0))),"No Exact Member ID & City Pair Match",INDEX('Master'!$B$2:$B$20000,MATCH('Usage Staging'!$R2&'Usage Staging'!$N2,'Master'!$A$2:$A$20000&'Master'!$G$2:$G$20000,0)))))))}

    This works fine, but I'd like to tweak it by making the H to O and G to N matches work where the string in H is found in O and the string in G is found in N; in other words, I'd like partial matching to work, as long as H and O are completeley found in G and N, respectively.

    Thanks!

  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,933

    Re: Return Values in of Cells in a Column where Two Other Values in Corr. Rows Match Crite

    Hi and welcome to the forum

    Without being able to see what that formula is actually doing and what it's working with, it's kinda hard to offer many firm suggestions.

    However, I would say that, as you are using 2010, you take a look at the iferror() function to simplify the formula a bit. So you can shorten...
    IF(ISERROR(INDEX('Master'!$B$2:$B$20000,MATCH('Usage Staging'!$R2&'Usage Staging'!$O2,'Master'!$A$2:$A$20000&'Master'!$H$2:$H$20000,0))),"No Exact Member ID & State Pair Match",INDEX('Master'!$B$2:$B$20000,MATCH('Usage Staging'!$R2&'Usage Staging'!$O2,'Master'!$A$2:$A$20000&'Master'!$H$2:$H$20000,0)))
    to...
    =IFERROR(INDEX(Master!$B$2:$B$20000,MATCH('Usage Staging'!$R2&'Usage Staging'!$O2,Master!$A$2:$A$20000&Master!$H$2:$H$20000,0)),"No Exact Member ID & State Pair Match")

    Also, to further simplify things, consider adding helper columns to combine...'Usage Staging'!$R2&'Usage Staging'!$O2 and Master!$A$2:$A$20000&Master!$H$2:$H$20000...so that you only need to refer to 1 cell and can also do away with the array function.

    Please consider uploading a sample file (no sensitive info), showing the data you are working with, a few examples of your expected outcome, and how you arrived at them.
    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

+ 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