Paul, Thanks for the help.Is there any macro for this? On Tue, Mar 10, 2009 at 11:46 AM, Paul Schreiner <schreiner_p...@att.net>wrote:
> This is basic Excel functionality. > let's say your sample data is in rows 2,3,4 (column headings in row 1) > > to "build" your function, select Cell C2 and start the Function Wizard > select the "IF" function. > with the type-in bar in the Logical_Test box, click cell A2, then type <> > and click in cell B2. the result should read: > A2<>B2 > In the next box (Value_if_true), enter 0 > in the next box (Value_if_false), enter 1. > then hit "ok" to complete the formula. > > the result should be: > =IF(A2<>B2,1,0) > > You COULD use: > =IF(A2=B2,0,1) which tests if they are the SAME instead if different. > > In column D, use the function wizard to make: > =IF(C2=0,0,A2-B2) > > then, copy these formulas down the rows... > > P > > ------------------------------ > *From:* Skanda <skanda.pokkun...@gmail.com> > *To:* excel-macros@googlegroups.com > *Sent:* Tuesday, March 10, 2009 10:32:47 AM > *Subject:* $$Excel-Macros$$ Compare two columns!! > > > Hi Guys, > If I need to compare two columns in the same worksheet say column A and > Column B. If there is a difference between two corresponding cells in A and > B then result should be '1' in correspoding cell in column C else result > should be '0'.And the difference between col A andCol B should be displayed > in Col D > > Also the same scenario if we need to compare two columns in two worksheets > how is this achieved? > > Col A Col B Col C Col D > 5 5 0 0 > 7 2 1 5 > 4 9 1 -5 > > > > Thanks for your help > > > > > > --~--~---------~--~----~------------~-------~--~----~ ------------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com ------------------------------------------------------------------------------------- -~----------~----~----~----~------~----~------~--~---