Consulting

Results 1 to 5 of 5

Thread: Match 1st ?? in column vertically, if Yes, then see if 2nd ?? matches horizontally?

  1. #1
    VBAX Tutor
    Joined
    Jul 2015
    Posts
    212
    Location

    Match 1st ?? in column vertically, if Yes, then see if 2nd ?? matches horizontally?

    Looking for a function to insert in $D2..., that asks the question, " Vlookup $A2 in F:F and if a match, hlookup along same row as first match, columns G:J and see if $B2 matches any value in that row?" Return "YES" if a match in F:F and a match in same row, columns G:J. "NO" if no match found.

    Cheers
    Attached Files Attached Files

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    In your file, in D2:
    =IF(ISNA(MATCH(VALUE($B2),OFFSET($G$1,MATCH($A2,$F$2:$F$8,0),0,,4),0)),"NO" ,"YES")
    copied down.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Tutor
    Joined
    Jul 2015
    Posts
    212
    Location
    Champion!...thanks Pascal, brilliant as always.

  4. #4
    VBAX Tutor
    Joined
    Jul 2015
    Posts
    212
    Location
    Pascal, I need an Add-On? This formula works great, but in the instance that it finds no records in Col F to Match, it will still produce a "NO". I'd prefer a " ". This will give an option 3, which is that there are no records to match. I can't use IFERROR, as it doesn't throw one?
    Cheers

  5. #5
    VBAX Tutor
    Joined
    Jul 2015
    Posts
    212
    Location
    Pascal, I sorted it:
    =IFERROR(IF((MATCH($A9,$F$2:$F$10,0))<>"",IF(ISNA(MATCH(VALUE($B9),OFFSET($G$1,MATCH($A9,$F$2:$F$10,0),0,,4),0)),"NO","YES")),"")
    No doubt you could improve on it in a Master Class moment?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •