Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If statement when two cells are the same
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, -- Q3PD |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If statement when two cells are the same
=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. -- David Biddulph "q3pd" wrote in message ... 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, -- Q3PD |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
If statement when two cells are the same
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. -- Q3PD "David Biddulph" wrote: =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. -- David Biddulph "q3pd" wrote in message ... 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, -- Q3PD |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formatting Cells using an If Statement | Excel Worksheet Functions | |||
Can I use an IF statement to reference 2 different cells? | Excel Worksheet Functions | |||
Can I use an IF statement to reference 2 different cells? | Excel Worksheet Functions | |||
Can I use an IF statement to reference 2 different cells? | Excel Worksheet Functions | |||
if statement for summing cells | Excel Discussion (Misc queries) |