Jan 24 2023 05:08 AM
Good day,
I have the folloeing problems with an example workbook attached, that I was wondering whether anyone can help with. It involves formulas which I cannot get right/don't understand. Many htnaks in advance.
Problem 1)
I would like cell B2 from Sheet1 to return a ‘Yes’ if any of the corresponding answers from Sheet2 with the same account numbers match a ‘banana’ in B:B
Problem 2)
I would like cells c:c from Sheet 1 to return a result of ‘yes’, if the corresponding account number on Sheet2 has a vegetable with 3 labels matching (would expect just account number 2 to be a ‘yes’
Jan 24 2023 06:05 AM
1.
=LET(results,UNIQUE(FILTER(Sheet2!$B$2:$B$31,Sheet2!$A$2:$A$31=A2)),IF(XOR(results="banana"),"Yes",""))
2. This formula presumes '3 labels matching' means 3 unique labels matching.
=LET(labels,UNIQUE(FILTER(Sheet2!$D$2:$D$31,Sheet2!$A$2:$A$31=A2)),IF(COUNT(labels)>2,"Yes",""))
Jan 24 2023 06:21 AM
If with pre-DA Excel
=IF( ISNA( MATCH(A2&"banana", Sheet2!A:A&Sheet2!B:B, 0) ), "no", "yes")
=IF( COUNTIFS(Sheet2!A:A,A2, Sheet2!C:C, "vegetable" ) >= 3, "yes", "no" )
Jan 24 2023 01:00 PM
Jan 24 2023 01:03 PM
Jan 24 2023 01:16 PM
Try this:
=LET(labels,FILTER(Sheet2!$D$2:$D$31,Sheet2!$A$2:$A$31=A2),IF(COUNT(labels)>2,"Yes",""))
Jan 24 2023 01:24 PM
Jan 24 2023 01:46 PM
Updated formula with the "vegetable" criteria.
=LET(labels,FILTER(Sheet2!$D$2:$D$31,(Sheet2!$A$2:$A$31=A2)*(Sheet2!$C$2:$C$31="Vegetable")),IF(COUNT(labels)>2,"Yes",""))
Jan 24 2023 01:48 PM
SolutionIn B2:
=IF(COUNTIFS(Sheet2!$A$2:$A$31,A2,Sheet2!$B$2:$B$31,"banana"),"yes","no")
In C2:
=IF(COUNTIFS(Sheet2!$A$2:$A$31,A2,Sheet2!$C$2:$C$31,"vegetable")>2,"yes","no")
Fill down.
Jan 24 2023 02:31 PM
Jan 24 2023 02:34 PM