+ Reply to Thread
Results 1 to 38 of 38

Formula to pull only the differences between sheets

  1. #1
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Formula to pull only the differences between sheets

    Hi! Attached is a sample of a workbook I am working with. I have used Index formula's to pull fields but this example has me stumped. I have 5 sheets in this workbook. The first, Sheet A "OCC-GEO" have what the OCC and GEO codes should be for employees in E and F columns. The next two sheets, sheets B and C, are what codes each employee currently has in separate sheets for each field, both in column G. The next two sheets, sheets D and E, I am trying to pull only where there are changes between the new codes on A and the existing codes in B and C sheets. Any ideas how this can be done?
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,934

    Re: Formula to pull only the differences between sheets

    Welcome to the forum.

    I am confused by your sample: what exactly are you showing us? Which is the 'before' and which the 'after'?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    Thank you! Sheet A is the after, Sheets B and C are the before and Sheets D and E would be only the differences. Does that help?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,934

    Re: Formula to pull only the differences between sheets

    Sort of. Can you, in words, describe what the difference would be. I'm struggling to see the pattern (maybe not enough coffee yet ...).

  5. #5
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    Sure, for Sheets D and E and put what the expected results should be. Sheet D has two employees with two OCC codes because those are the only two OCC codes that changed between sheet A and sheet B. Sheet E has two employees with two GEO codes because those are the only two GEO codes that changed between sheet A and sheet C. Does that help? Coffee is life!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,934

    Re: Formula to pull only the differences between sheets

    Yes, it does. One more question: is column A a unique ID per record?

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,934

    Re: Formula to pull only the differences between sheets

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. As you are new, I will do it for you today: https://www.mrexcel.com/board/thread...heets.1174925/.)

  8. #8
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    ahh, good to know! Thank you for letting me know. I tried to remove the other post but there isn't an option so I will message the administrator to remove.

    Yes, the ID's are unique in column A

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,934

    Re: Formula to pull only the differences between sheets

    You can post on multiple forums with impunity as long as you tell us!

  10. #10
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    Got it. My mistake!

  11. #11
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Formula to pull only the differences between sheets

    I'm assuming with PropPlus you have the Dynamic Array formulas available to you. Your sample data shows that the order of the sheets are exactly the same (Employee Number Ascending). If this is always the case, then try this on Sheet D:

    =FILTER(FILTER('(B) ExistingOCC'!A2:G9,'(A) OCC-GEO'!A2:A9&'(A) OCC-GEO'!E2:E9<>'(B) ExistingOCC'!A2:A9&'(B) ExistingOCC'!G2:G9),{1,1,1,0,0,0,1})

    and in Sheet E:

    =FILTER(FILTER('(C) ExistingGEO'!A2:G9,'(A) OCC-GEO'!A2:A9&'(A) OCC-GEO'!F2:F9<>'(C) ExistingGEO'!A2:A9&'(C) ExistingGEO'!G2:G9),{1,1,1,0,0,0,1})

    See attached.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    I do have Dynamic Arrays in my Excel although I am just now learning about them. This looks awesome, thank you! In theory if unique rows are added that meet the filter criteria they will appear in sheets D and E automatically?

  13. #13
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Formula to pull only the differences between sheets

    Yes, as long as you are referencing the cells. I would suggest putting the sheets in an Excel table. An example of that is attached.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    This is amazing and exactly what I was looking for. Thank you so much!

  15. #15
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    Quick question. If I want to add a column in sheets D and E to pull an additional field how do I do that? When I insert, the header shifts and not the results of the two examples.

  16. #16
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Formula to pull only the differences between sheets

    Well, I don't know exactly what you are trying to do, but that's what the 1's and 0's are for at the end of the formula - a 1 means you want to display the column and a 0 means you don't - based on the columns being filtered. (in the formula above, I reference columns A-G (7 columns) so there are 7 0's and 1's at the end of the formula.

  17. #17
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    Ahhh, okay. Perfect Gregb11. Thank you again!

  18. #18
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Formula to pull only the differences between sheets

    You're welcome. And thanks for the rep.

  19. #19
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    Okay, maybe I have one more question. How do I access the Tables? Normally a separate table menu appears when clicked in one of the cells but that doesn't seem to be the case here. UPDATE: Nevermind! Brain Fart.
    Last edited by nordicmetal; 07-01-2021 at 06:33 PM.

  20. #20
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    I guess what I was trying to do is see if I can expand the filter formula area if I add a new column and pull another field. It has a bounding box and insert column does not expand it. How is that done? Is it also possible to format sheets D and E as a table so it is in import ready format without losing the formula that pulls the information into the sheet to begin with?

  21. #21
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Formula to pull only the differences between sheets

    If I understand you correctly, yes, you can expand the filter area if you add new columns and want to show them on the other sheets.
    It has a bounding box and insert column does not expand it.
    I don't know what you mean here.

    You cannot use dynamic array formulas and Excel Tables at the same time.

    so it is in import ready format without losing the formula that pulls the information into the sheet to begin with?
    I'm not sure what you mean here either.

  22. #22
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    So how do you expand the table? Once I insert a new column between columns A and B the 1's and 0's refer to the same cells.

  23. #23
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Formula to pull only the differences between sheets

    If you expand the table, you'll need to adjust your 0's and 1's. If you can attach the file I can look at it.

  24. #24
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    I would love to know what I did wrong. I now have 8 columns and there are 7 0's/1's. I tried highlighting the table and renaming Table 1.1 however that didn't work either. See attached.
    Attached Files Attached Files

  25. #25
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Formula to pull only the differences between sheets

    It's filtering Table2, not Table1 and Table2 has 7 columns. If you want it to show from table1, then use this:

    =FILTER(FILTER(Table1,Table1[Employee Number]&Table1[OCC]<>Table2[Employee Number]&Table2[OCC]),{1,1,1,1,0,1,0,1})
    (and change the 0's and 1's appropriately.)

  26. #26
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    That's perfect, thank you! Next issue appears to be with Table1, Table2, and Table3. They don't auto-expand when I add a couple hundred rows of data. I went to the Name Manager and it will not allow me to change the cell references. I tried creating new tables that reference the entire columns but it doesn't like the formula and tells me there was a problem with it. Thoughts? Sorry!

  27. #27
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,934

    Re: Formula to pull only the differences between sheets

    Your tables expand for me - how are you adding the extra rows of data?

  28. #28
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    Actually, I stand corrected. The table expanded but because I am now getting value N/A errors on the D and E sheets I presumed it was due to the tables. I am simply copying and pasting as values from reports I am running with the same columns of information and ensuring the numbers are formatted correctly. Oddly, when I paste thousands of rows of data I get N/A's but when I paste one row of data for the same employee the formula picks it up. Any ideas? I'll see if I can replicate the issue with a smaller dataset and disguise the info.

  29. #29
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    It looks like it is only an issue when I paste more rows than the current table has and I get a message that states "This Table inserted rows into your worksheet. This may cause data in cells below the table to shift down." Once I click okay it expands the table and seems to be okay until I look at the sheets with the Filter formulas and it just has #N/A's. I also just tried inserting blank rows in the middle of the table, it expands, but then the Filter formulas become #N/A's even though the data hasn't changed above and below the empty rows I added.

  30. #30
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Formula to pull only the differences between sheets

    Can you attach the file?

  31. #31
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    Here it is with only one empty row inserted on sheet A row 4 and then I input sample data. It skewed the output on D and E sheets.
    Attached Files Attached Files

  32. #32
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Formula to pull only the differences between sheets

    The tables have to be the same size. The assumption was to find those that have changed, assuming that the same records are in each table, just the value has changed. It also assumes they are in the same order. If these are incorrect assumptions, then this solution won't work.

  33. #33
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    Okay, so if I understand you correctly, if I paste new data in A B and C and the Tables differ in size, as long as I add additional blank rows so all the tables are the same length AND they are in ascending order by number it will work?

  34. #34
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Formula to pull only the differences between sheets

    Yes, it should.

  35. #35
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    I'm confused. I have my dataset now in A, B, and C but you are saying if John Doe is not on all three sheets on the same rows this will not work? I thought the formula references the employee number and only displays updates if there Data from A does not equal data from B and C? Attached is a sample. Any new hires will throw off the dataset and consider everything in need of an update.
    Attached Files Attached Files

  36. #36
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Formula to pull only the differences between sheets

    The whole premise of this solution was based on the assumption that both lists would contain the same list of employee ID's in the same order and it was to determine if the OCC (or GEO) numbers were different. Is that not the case? If you are going to have the lists in different order or have some employees on one sheet but not the other, then a different solution will be required.

  37. #37
    Registered User
    Join Date
    06-25-2021
    Location
    Portland, OR
    MS-Off Ver
    365 ProPlus
    Posts
    20

    Re: Formula to pull only the differences between sheets

    That would not be the case. Sorry, I have had different employees on my lists and when we were discussing them being in the same order I thought you were referring to the sort order of the Employee number.

  38. #38
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Formula to pull only the differences between sheets

    OK, with this formula, it doesn't matter if the number of employees match on each table (either could be larger than the other). It also doesn't matter what order they are in. It compares the Employees in Table1 to the employees in Table 2 and if the same employee ID in Table1 has a different OCC in Table2, it shows the info from table. (this would go in cell A2 of Sheet (D))

    =IFERROR(FILTER(FILTER(Table1,ISNA(MATCH(Table1[Employee Number]&Table1[OCC],Table2[Employee Number]&Table2[OCC],0)),"None"),{1,1,1,1,0,1,0,0}),"All Match")
    Attached Files Attached Files

+ 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. Formula to pull data from different sheets to one
    By paycep86 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-16-2021, 06:48 AM
  2. [SOLVED] Need a formula pull data from 2 sheets
    By jackson_hollon in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 02-23-2020, 02:13 PM
  3. Replies: 0
    Last Post: 04-13-2015, 01:01 PM
  4. [SOLVED] Pull information from sheets according to a formula result+cell reference
    By c887173 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-09-2014, 06:06 PM
  5. Formula to pull highest amount between sheets
    By janice526 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-17-2014, 03:23 AM
  6. Formula pull values from different sheets
    By lamdl in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-03-2014, 05:21 PM

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