user3067028
user3067028

Reputation: 159

IF Statement on Range Of Cells

I have a range of cells that I would like to look at with this if statement. I basically want this formula to look at the "Customer" and then look at a list of Customers that provide their own routing, if that "Customer" is on that list (in that range of cells) then i would need for the formula to return a "Y" for yes and if they are not on that list then i just need an "N" for no. I've included a picture. Then range of cells that it needs to look at is G10:G28.example

Upvotes: 0

Views: 55126

Answers (2)

barry houdini
barry houdini

Reputation: 46361

You could use COUNTIF like this

=IF(COUNTIF(G$10:G$28,F2),"Y","N")

Upvotes: 1

Davis
Davis

Reputation: 250

A VLOOKUP can tell if an item is in the first column of a specified set of cells. You could wrap it in an if in order to give you the Y/N value

The basic syntax would be like this.

=IF(ISNA(VLOOKUP(F2, $G$10:$G$28, 1, false)), "N", "Y")

Additionally, if you had a specific value that you wanted to display when a match was found, you could have that value in column H and use a slightly different formula. You'll want to further investigate the VLOOKUP function if you are not familiar with how it works. Something like =IFERROR(VLOOKUP(F2, $G$10:$H$28, 2, false), "N")

Upvotes: 2

Related Questions