Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting Cells using an If Statement Seanb Excel Worksheet Functions 5 September 6th 07 05:10 PM
Can I use an IF statement to reference 2 different cells? Shan Excel Worksheet Functions 0 November 29th 06 06:26 PM
Can I use an IF statement to reference 2 different cells? Alok Excel Worksheet Functions 0 November 29th 06 05:45 PM
Can I use an IF statement to reference 2 different cells? Vaughan Excel Worksheet Functions 0 November 29th 06 05:36 PM
if statement for summing cells Gavin0268 Excel Discussion (Misc queries) 7 May 3rd 06 04:47 PM


All times are GMT +1. The time now is 12:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"