+ Reply to Thread
Results 1 to 11 of 11

Comparing and mark data from two different worksheet

  1. #1
    Forum Contributor
    Join Date
    07-04-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    105

    Red face Comparing and mark data from two different worksheet

    Hello guys. I'm new and i wanna ask experts here how to solve my problem.


    I have two worksheet and each contains series of Serial Number and Operation Number. So how can the first worksheet ( will be marked) can be compared with the second worksheet ( reference ) if it has the same Serial Number and Operation number ( fullfill both conditions) . If the first worksheet contains redundant data, the third row will be marked and indicated, let say with "submitted" .

    I have read about vlookup and if function, but i'm not doing so well or maybe they doesnt suit this kind of problem .


    Thanks in advance for helping.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Comparing and mark data from two different worksheet

    Put this in C5 and copy down. Expand the ranges as needed. Do not try to use full columns, just the ranges needed:

    =IF(ISNUMBER(MATCH(A5&"-"&B5, INDEX(Sheet2!$A$6:$A$14&"-"&Sheet2!$B$6:$B$14, 0), 0)), "Submitted", "")
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    07-04-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    105

    Re: Comparing and mark data from two different worksheet

    ok thank you. Thats work impressively for me..

    But is it possible to be done automatically? I mean everyday i need to update both sheet1 and 2 with new serial and operation number, which involve hundreds of rows per week need to be top-up. so what if the comparison can be done without a need to drag down the formula in c5.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Comparing and mark data from two different worksheet

    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Forum Contributor
    Join Date
    07-04-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    105

    Re: Comparing and mark data from two different worksheet

    this video is about my first question in the tittle or the latter add-on one... ?

    because it took quite time to fully buffer the video. and i dont bring my earphone. in the office right now.

  6. #6
    Forum Contributor
    Join Date
    07-04-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    105

    Re: Comparing and mark data from two different worksheet

    ok thanks marvin..

    watched already.

    but this double click only works downwards only right? what if i need to top up every serial and operation number on the top of the list so it will be sorted based on its modified date.Does this method works as well?

    Plus,i need to adjust the range every time new data kept in. i can extend them up to 10000 rows but what if it exceeds the limit without i realize. Even 10000000 can wok i guess.


    =IF(ISNUMBER(MATCH(A5&"-"&B5, INDEX(Sheet2!$A$6:$A$14&"-"&Sheet2!$B$6:$B$14, 0), 0)), "Submitted", "")

    so, do you think any way better?
    Last edited by pyol17; 07-08-2012 at 11:18 PM.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Comparing and mark data from two different worksheet

    Here's a little macro to input the formula for you on SHeet1 in the range needed, expanding the reference range on sheet2 as needed:

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-04-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    105

    Re: Comparing and mark data from two different worksheet

    honestly speak, i never use macro before.but after some googling, i paste ur coding into visual basic and run it. even that i'm not sure doest those code works or not.

    Then i tried to insert more than 200 rows of serial number to be tested.

    so even the formula range only =IF(ISNUMBER(MATCH($A211&"-"&$B211, INDEX(Sheet2!$A$6:$A$31&"-"&Sheet2!$B$6:$B$31, 0), 0)), "Submitted", "")
    , it works entirely for new data entry, exceeding 200 rows.


    i guess this problem is totally solved. Thank u JBeaucaire for ur help.

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Comparing and mark data from two different worksheet

    Well, it's not true the formula would work if the 200 rows was on Sheet2, but if the 200 rows is on sheet1 and the range on sheet2 is still just A6:B31, yes, the original formula would work.


    If the range of reference data on sheet2 expands, the macro would edit the formula for you.

    Glad it's working for you.

  10. #10
    Forum Contributor
    Join Date
    07-04-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2007
    Posts
    105

    Re: Comparing and mark data from two different worksheet

    prototaip.xlsx

    i have used ur formula , but i insert it on L18 in ''checklist'' sheet. The reference sheet2 i renamed it become ''submitted'' .And few changes in term of position only.


    The formula works fine, but i only need to adjust the range.


    So can you help me to alter the macro part to fit my new changes.Really apreciate ur help dude.

  11. #11
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Comparing and mark data from two different worksheet

    Please Login or Register  to view this content.

    The edits are in red, with the original code and now this edited version, you should be able to adapt your own edits in the future.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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