+ Reply to Thread
Results 1 to 21 of 21

How to compare data in Excel 2010

  1. #1
    Registered User
    Join Date
    09-11-2013
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    How to compare data in Excel 2010

    Hi everyone.

    I have some data I need to compare in Excel 2010.

    It looks something like this:

    1 2 1 2 1 2
    1 2 1 5 1 2
    1 2 1 2 1 2
    1 8 1 2 9 2
    1 2 1 2 1 2
    1 2 4 2 1 2
    1 2 1 2 1 2

    and it needs to be compared with:

    1 2
    1 2
    1 2
    1 2
    1 2
    1 2
    1 2

    These same two columns should be used to compare all 6 columns in the first piece of data. The 1 columns should be compared and the 2 columns should be compared.

    As an output I need a list of all cells that don't match what they are being compared with.

    Any suggestions on how I might achieve this?
    Last edited by Dawud Beale; 09-12-2013 at 08:04 AM.

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: How to compare data in Excel 2010

    Cross posted http://www.mrexcel.com/forum/excel-q...el-2010-a.html

    Please read Excelguru Help Site - http://www.excelguru.ca/content.php?184
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Registered User
    Join Date
    09-11-2013
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: How to compare data in Excel 2010

    Oh sorry I've never heard of cross posting before. I was just looking to get an answer and wasn't sure I'd definitely get one here.

    In future I will stick to one and if I don't get a reply after a few days I will post somewhere else but will include the initial link.

    Thanks for the information

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: How to compare data in Excel 2010

    No answers on the cross post yet.

    Maybe elaborate more on your requirements? My brain hurts reading this sentence...
    The 1 columns should be compared and the 2 columns should be compared.
    and, most preferably, post also an example of how the results should look like, based on your "sample" data in the first post.

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How to compare data in Excel 2010

    Not 100% sure what you expect in terms of output but this builds a table of TRUE/FALSE if the values match.

    There is an example using the 2 column tables as values and an example where 1 and 2 are derived.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  6. #6
    Registered User
    Join Date
    09-11-2013
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: How to compare data in Excel 2010

    What Andy has done is basically what I was looking to do. Except leaving it blank when the data matches and displaying the value of the data when it doesn't match, rather than displaying true or false.

    I am now trying to make a count of the total errors in the data array.

    As the cell is blank when the data matches, I tried =COUNTIF(AV3:CA98, "*")but it seems to count a blank space i.e. " ". How could I make a count that only includes data that doesnt match the sample data?

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How to compare data in Excel 2010

    I1: =IF(A1=INDEX($A$12:$B$18,ROW(),MOD(COLUMN()-COLUMN($I$1),2)+1),"",A1)

    and this to report 4 mis matches
    =COUNT(I1:N7)

  8. #8
    Registered User
    Join Date
    09-11-2013
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: How to compare data in Excel 2010

    Oh thats a little complicated. How do i adjust that formula to work on my spreadsheet?

    I put it into the experimental spreadsheet you made for me and it doesnt do anything. Any advice?
    Last edited by Dawud Beale; 09-11-2013 at 09:10 AM.

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How to compare data in Excel 2010

    Really?

    Original formula
    =A1=INDEX($A$12:$B$18,ROW(),MOD(COLUMN()-COLUMN($I$1),2)+1)

    updated formula
    =IF(A1=INDEX($A$12:$B$18,ROW(),MOD(COLUMN()-COLUMN($I$1),2)+1),"",A1)

    a few characters added to start and finish

  10. #10
    Registered User
    Join Date
    09-11-2013
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: How to compare data in Excel 2010

    That just comes out blank as a blank result on my spreadsheet

  11. #11
    Registered User
    Join Date
    09-11-2013
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: How to compare data in Excel 2010

    Ok i used this formula to compare the real data with the sample data:

    =IF(K3=$AS3,"",K3)

    For some reason though, when I use this formula on 189 cells:

    =COUNTIF(BQ15:BY35, "*")

    The value is 189. Even though the vast majority of the cells are blank.

    They are blank because the samlpe data matches the real data

  12. #12
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How to compare data in Excel 2010

    Although I never explicitly said I assume you entered the formula and then copied over and down the rest of the cells in the table, so range I1:N7

    The wildcard will cause any cell in that range that contains a formula to be counted.


    Assume the return values are "" or number use
    =COUNT(BQ15:BY35)

  13. #13
    Registered User
    Join Date
    09-11-2013
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: How to compare data in Excel 2010

    Is this on the sample spreadsheet you made? you already have a formula there so wont it copy over the top of it?

    How do I make this formula look at the end result of the formula of the cell its looking in rather than the formula itself?

    =COUNTIF(BQ15:BY35, "*")
    Last edited by Dawud Beale; 09-11-2013 at 09:34 AM.

  14. #14
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How to compare data in Excel 2010

    Yes in the sample file and yes it will. But that is okay because you wanted the formula to return different results to the ones I had.

    basically what I was looking to do. Except leaving it blank when the data matches and displaying the value of the data when it doesn't match, rather than displaying true or false
    Last edited by Andy Pope; 09-11-2013 at 09:44 AM. Reason: matching tags

  15. #15
    Registered User
    Join Date
    09-11-2013
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: How to compare data in Excel 2010

    Oh sorry i apologise we are talking about different things. ok I am with you now. Ah so basically how to leave it blank if the data matches.

    Ok so now how do I get excel to count the number of non matching data?

  16. #16
    Registered User
    Join Date
    09-11-2013
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: How to compare data in Excel 2010

    I just tried your updated formula and it works. I need a way to count the number of items of data rather than the sum of the value of the data though. Also the data I actually have is hexadecimal and has an 0x at the begining so may be something like 0xFF or something. So it cant be counted numerically. I need to count the number of entries that don't match the original data

  17. #17
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How to compare data in Excel 2010

    two ways to count.

    Array formula, commit using CTRL+SHIFT+ENTER,

    =SUM(IF(I1:N7<>"",1,0))

    or normal formula

    =COUNTA(I1:N7)-COUNTBLANK(I1:N7)
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    09-11-2013
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: How to compare data in Excel 2010

    I still cant get those formulas to work on mine for some reason, even though they work on yours. Any ideas why?

  19. #19
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: How to compare data in Excel 2010

    not without seeing yours.

  20. #20
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: How to compare data in Excel 2010

    Dawud Beale,

    See your posted thread on MrExcel for screenshots and a macro, by me, hiker95 on MrExcel.

    http://www.mrexcel.com/forum/excel-q...el-2010-a.html

  21. #21
    Registered User
    Join Date
    09-11-2013
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: How to compare data in Excel 2010

    Thanks for all the help everyone. Its working.

    Just as a final tool that I'd like to have, is it possible to get excel to list all the errors in 2 columns?

    a 5555 column containing all the erroneous 5555 data:

    555a
    0505
    55f5

    etc

    and an AAAA column containing all the erroneous AAAA data:

    AAA0
    AABA
    FAAA
    A9A9

    etc

    If there is a way to do this, it will be excellent

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Using DAO to pull data from Access 2010 into an Excel 2010 table
    By Ragnaros in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-23-2013, 01:28 PM
  2. Importing data from a Word 2010 form to Excel 2010.
    By mlang in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-16-2012, 08:55 AM
  3. Importing data from an Excel 2010 worksheet into a Word 2010 form.
    By Kuriakos in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2012, 02:49 PM
  4. Excel 2010 Macro Needed for Search, Compare & Change
    By BlueMoonNJ in forum Excel Programming / VBA / Macros
    Replies: 28
    Last Post: 05-08-2012, 04:38 PM
  5. Replies: 1
    Last Post: 05-24-2011, 05:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1