If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > IF Statement Comparison in Excel spreadsheet

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-13-10, 17:40
elizabeth1 elizabeth1 is offline
Registered User
 
Join Date: Aug 2004
Posts: 48
IF Statement Comparison in Excel spreadsheet

I'm trying to compare cells in a spreadsheet that has 2 worksheets.

Example: I need to compare the data in Sheet 1,rows A5:I5 with the corresponding cells in Sheet 2. If the data in both match then the result should be "Yes" and "No" if the data doesn't match.

Any suggestions? Any help will be appreciated.
Reply With Quote
  #2 (permalink)  
Old 04-15-10, 10:39
weejas weejas is offline
Registered User
 
Join Date: Sep 2006
Location: Surrey, UK
Posts: 448
What you need depends on which sheet needs to show the comparison, and whether you're showing a match cell for cell, or just in total. Working on the assumption that sheet 1 needs to show the comparison, and you're working cell by cell, enter the following in A6 on sheet 1:
Code:
=IF(A5 = Sheet2!A5, "Yes", "No")
Copy this across to I6.
Then, in A7, enter this:
Code:
=COUNTIF(A6:I6, "Yes")
HTH!
__________________
10% of magic is knowing something that no-one else does. The rest is misdirection.
Reply With Quote
  #3 (permalink)  
Old 04-15-10, 15:24
elizabeth1 elizabeth1 is offline
Registered User
 
Join Date: Aug 2004
Posts: 48
IF Statement Comparison in Excel spreadsheet

To Weejas:

I appreciate the help. Thanks.
Reply With Quote
  #4 (permalink)  
Old 04-22-11, 14:30
ExcelGuru545 ExcelGuru545 is offline
Registered User
 
Join Date: Apr 2011
Posts: 4
In addition

Make sure your sheet reference has quotations around it. This will protect you against errors if you have spaces in your sheet names.

-C.W.
Excel Statement
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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