Search code examples
excelformulaexcel-2013

If condition1 and 2 are true (cell compare to a range of cells) than show a specific value in excel


I want to create a function when two comparative conditions are True than a cell takes a specific value.

This is the Function i am trying to use:

=IF(AND("City"="List of cities","Product"="List of products")*TRUE,Cell Value,NA())

When i compare a cell with another cell, the formula works fine but when i compare a cell with a range of cells the result is False.

How can I fix this problem?


Solution

  • Take a look at using VLOOKUP or MATCH, in combination with ISERROR

    =IF(AND(ISERROR(MATCH("City","List of cities",0))=FALSE,ISERROR(MATCH("Product","List of products",0))=FALSE),"Cell Value",NA())