IF and Then in Excel

S

Satnam Randhawa

I am trying to compare two different cells in two different worksheets.

If the value in A1 in sheet1 is in any of the cells in in sheet2, then value
in B1 in sheet1 should be equal to value in C1 in sheet2.
 
J

joeu2004

I am trying to compare two different cells in two different worksheets.
If the value in A1 in sheet1 is in any of the cells in in sheet2, then value
in B1 in sheet1 should be equal to value in C1 in sheet2.

See the follow-ups to your similar posting in this same newsgroup.
The difference is: the first condition here is that sheet1!A1 is
equal to __any__ cell in sheet2. I don't know if the one posting is a
correction of the other, or if you are truly asking two different
questions.

It is unclear to me whether you want to set sheet1!b1 to sheet2!c1 if
conditions are met, or if you want verify ("confirm") that sheet1!b1
equals sheet2!c1 if conditions are met. In other words, you want a
TRUE or FALSE result. If the latter, the following array formula
(commit with ctrl+shift+Enter) is one way:

=if(or(Sheet1!!A1=Sheet2!A1:C3), (Sheet1!B1=Sheet2!C1), "")

Here, "any of the cells" in Sheet2 is assumed to be the range A1:C3.

That leaves the cell looking blank if the first condition is not met.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top