----------------------------------------------------------------------------------------------------------------------------
Hi Skanda, Try this formula based solution: Col A Col B Col C Col D Row 1 5 5 =IF(A1=B1,0,1) =A1-B1 Row 2 7 2 =IF(A2=B2,0,1) =A2-B2 Row 3 4 9 =IF(A3=B3,0,1) =A3-B3 For more tips, tricks, downloads and problem solutions: visit --> http://www.excelitems.com ------------------------------------------------------------------------ Regards *Ashish **Jain* Analyst, CSC Microsoft Certified Application (Excel) Specialist Technical Trainer - Excel and VBA Author -> www.excelitems.com +91-9999-40-48-43 ---------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------- On Mar 10, 7:32 pm, Skanda <skanda.pokkun...@gmail.com> wrote: > 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 ------------------------------------------------------------------------------------- -~----------~----~----~----~------~----~------~--~---