简体   繁体   中英

IF condition with VLOOKUP in Google Sheets

I want to compare below two sheets (compare all the available cells together on both the sheets) with vlookup. if the one line is available in both the sheets then answer should be "Yes,". if else answer should be "No!".

I have below data in sheet1

PONo        Code    UID
84914741980 VPP5P   14908660
84914741893 VPP5P   14908653
84914750226 XWKGY   14915367
84914740202 XWKGY   14907478
84914751843 R10KJ   14915997
84914750226 R10KJ   14915366
84914759442 CPC7G   14921768
84914750025 TN78Y   14913781

another sheet2 contains below data,

PONo        Code    UID
84914741980 VPP5P   14908660
84914741893 VPP5P   14908653
84914750226 XWKGY   14915367
84914750025 TN78Y   14913781
84914750025 TN78Y   14913779
84914743001 TN78Y   14909949
84914740202 TN78Y   14907477
84914740202 TN78Y   14907476
84914741893 YH3T9   14908652

I want the answer to be like below

PONo        Code    UID         Answer
84914741980 VPP5P   14908660    Yes
84914741893 VPP5P   14908653    Yes
84914750226 XWKGY   14915367    Yes
84914740202 XWKGY   14907478    No
84914751843 R10KJ   14915997    No
84914750226 R10KJ   14915366    No
84914759442 CPC7G   14921768    No
84914750025 TN78Y   14913781    Yes

Appreciate forums help to get this done!!

I tried the below formula, but it works partially.

 =if(ARRAYFORMULA(VLOOKUP($A:$C,sheet2!$J:$L,{1,2,3},false))="","No","Yes")

try like this:

=ARRAYFORMULA(IF(A2:A<>"", IF(IFERROR(VLOOKUP(A2:A&B2:B&C2:C, 
 Sheet2!E2:E&Sheet2!F2:F&Sheet2!G2:G, 1, 0))<>"", "yes", "no"), ))

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM