You can use MATCH
to check if the value from column 1 is in column 3 (MATCH
returns a number when there is a match, an error otherwise), then VLOOKUP
to get the percentage, all within IF
statements:
=IF(ISNUMBER(MATCH(A2, C:C, 0)), IF(VLOOKUP(A2, C:D, 2, 0)=1, "ok", 0), "no")
The above assumes that the values in column 4 are numeric values formatted as percentages.
VLOOKUP
works as follows:
VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
lookup_value
is the value you're searching.
table_array
is the table in which the search will be performed and also from where the result will be pulled from. The lookup_value
will be searched for in the first column of the table_array
. The result will be pulled from the col_index_num
th column in the table_array
.
[range_lookup]
will decide whether the search will be an exact search or an approximate search.
In the above formula, the VLOOKUP
looks for the value from A2, into column C, and returns the corresponding value from the 2nd column in table C:D (i.e. from column D) and ensures that this is an exact search (0 means exact, 1 means approximate).
As per discussion with OP, turns out that Column1 and Column3 were 3 separate columns that needed to be checked for. Since MATCH
and VLOOKUP
can only check 1 column at a time (unless having recourse to array invocation), COUNTIFS
would probably be more appropriate:
=IF(COUNTIFS(Sheet3!$B$13:$B$289,E5,Sheet3!$C$13:$C$289,F5,Sheet3!$D$13:$D$289,G5)=0,"no",IF(SUMIFS(Sheet3!N$13:N$289,Sheet3!$B$13:$B$289,E5,Sheet3!$C$13:$C$289,F5,Sheet3!$D$13:$D$289,G5)=1,"ok",0))
The above formula is what I've come up with which I believe is working for the provided sample data.