# Excel formula if statement with link

Closed
scott - May 21, 2010 at 02:23 AM
Trowa - May 21, 2010 at 09:22 AM
Hi all,
so if cell a1:a50 contain 5 digit product codes, and b1:b50 contain prices on a serperate sheet there will be a list off 100 product coes from a1:a100 named product, and in b1:b100 on the same sheet will be a price assosicated with that product code, called price.

I want a formula that will check if a1 = a value found in the list "product" and if it is found i want it to check if b1 matches the prices in the cell next to where it found the price in the list "product"
Make sense?

so if lists look like this
product and price
11111 250
11112 255
11113 265
11114 400
11115 350
11116 375

if a1 has 11113 and b1 has 255 c1 will say error

if a1 has 11113 and b1 has 265 c1 will say correct

Thanks everyone

Related:

## 2 responses

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
May 21, 2010 at 09:00 AM
Could you please upload a sample file with sample data etc on some shared site like https://authentification.site , http://wikisend.com/ , etc and post back here the link to allow better understanding of how it is now and how you foresee.
Hi Scott,

So sheet 1 looks like:

```11111	250
11112	255
11113	265
11114	400
11115	350
11116	375```

And sheet 2 looks like:

```11113	255
11113	265```

Then put the following formula in cell C1 on sheet 2:
`=IF(B1=Vlookup(A1,Sheet1!\$A\$1:\$B\$6,2),"Correct","Error")`
Drag the formula down as far as you need.

Sheet 2 cell C1 will display Error and C2 will display Correct.

Best regards,
Trowa