If statement when two cells are the same

Q

q3pd

I have cells C2, D2 and G2, H2 with numerical values in them. In K2 I want an
If statement that returns 'Yes' when C2, and G2's values match and also when
D2 and H2's values match and 'no' when they don't.

These numerical values are linked to employees and show if they have
actioned certain tasks. C2 and D2 values are before the task, G2 and H2's
values are after the task. I require 'Yes' returns to show which employees
have actioned their tasks.

E.g.: Tom, (Before the task) 5, 6, (After the task) 5, 6, would return
'NO'
Jane, (Before the task) 4, 7, (After the task) 2, 3 would return 'Yes'
Harry, (Before the task) 3, 8 (After the task) 3, 7 would return 'Yes'

How do I compile the required If statement?

Thank you,
 
D

David Biddulph

=IF(AND(C2=G2,D2=H2),"Yes","No") matches the words of your question, but
your example seems the opposite way round. Adjust the formula to suit what
you really want.
You may also wish to be clear about the place where you say "... and also
when ...". If you need both conditions to be true, it needs the AND
function. If either will do, it's an OR.
 
Q

q3pd

Thank you David for your swift response. I had it the wrong way round - all
done and correct. It reads AND and returns 'No' when the numbers are the same.
 

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