You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to compare differences between spreadsheets?

I have a couple of spreadsheets that I need to sort and compare.


The first spreadsheet is a list (single column) of product Serial Numbers in our primary inventory.


The second is a report (single column) of all product Serial Numbers we have on hand (that may not have been purchased or procured or inventoried in our primary inventory tool - which are trying to merge).


I need to compare and sort which ones are currently in there and strip the ones there not out into their own column.


I've done this manually but its not ideal because as inventory comes in the primary inventory data changes and it will tough to compare this manual set-up against that.


I checked some of the existing discussions and they don't seem to apply to my current need. Any ideas or help?


Thank you.

Posted on May 10, 2020 1:36 PM

Reply
Question marked as Top-ranking reply

Posted on May 11, 2020 12:30 AM

I've used two tables, but this could be done with one.

The formula shown below Existing Inventory is entered in B2 of that table, and filled down to the end of column B.


B2: IF(COUNTIF(central inventory::A,A2)<1,A2,"")


COUNTIF counts the occurrences, in column A of Central Inventory, of each number in column A.

If that count is less than 1, IF copies the number in column A to the same row of column B. IF the count is 1 or more, IF places a null string "" ) in that row of column B.


IF there are blank cells in column A of both tables, then the count for those rows of Existing will be greater than 0, and IF will attempt to copy the value in, say, A8 into B8. The enpty cell will be interpreted as containing the numerical value zero, and the result will be as in the last three cells of Existing::column B.


You can avoid these zeroes by wrapping the formula in a second IF statement that checks for content in column A and returns a null string if there is none. If there is a value in the cell, This IF calls the main one (shown in bold here, which acts as above.


B2: IF(LEN(A2)<1,"",IF(COUNTIF(central inventory::A,A2)<1,A2,""))


Transferring the selected numbers to Central Inventory:


The simplest way to do this is to add a temporary single column table to the sheet.

Select all cells of Existing inventory::B. Copy. Click on an empty space on the sheet (not in an exisitng table), then go to the Edit menu and choose Paste Formula Results. This strips the formulas from the copy, and pastes the last calculated value for each copy of the formula, placing them in a new single column table.


Sort the column Ascending to place the numbers in order,

select and copy the cells containing serial numbers,

then select the first empty cell at the bottom of the list in column A of Central Inventory, and paste.


Sort ascending on column A of Central Inventory to place the existing and new numbers into correct (alphabetical) order.


Delete the temporary single column table.


Regards,

Barry





7 replies
Question marked as Top-ranking reply

May 11, 2020 12:30 AM in response to Space Ranger

I've used two tables, but this could be done with one.

The formula shown below Existing Inventory is entered in B2 of that table, and filled down to the end of column B.


B2: IF(COUNTIF(central inventory::A,A2)<1,A2,"")


COUNTIF counts the occurrences, in column A of Central Inventory, of each number in column A.

If that count is less than 1, IF copies the number in column A to the same row of column B. IF the count is 1 or more, IF places a null string "" ) in that row of column B.


IF there are blank cells in column A of both tables, then the count for those rows of Existing will be greater than 0, and IF will attempt to copy the value in, say, A8 into B8. The enpty cell will be interpreted as containing the numerical value zero, and the result will be as in the last three cells of Existing::column B.


You can avoid these zeroes by wrapping the formula in a second IF statement that checks for content in column A and returns a null string if there is none. If there is a value in the cell, This IF calls the main one (shown in bold here, which acts as above.


B2: IF(LEN(A2)<1,"",IF(COUNTIF(central inventory::A,A2)<1,A2,""))


Transferring the selected numbers to Central Inventory:


The simplest way to do this is to add a temporary single column table to the sheet.

Select all cells of Existing inventory::B. Copy. Click on an empty space on the sheet (not in an exisitng table), then go to the Edit menu and choose Paste Formula Results. This strips the formulas from the copy, and pastes the last calculated value for each copy of the formula, placing them in a new single column table.


Sort the column Ascending to place the numbers in order,

select and copy the cells containing serial numbers,

then select the first empty cell at the bottom of the list in column A of Central Inventory, and paste.


Sort ascending on column A of Central Inventory to place the existing and new numbers into correct (alphabetical) order.


Delete the temporary single column table.


Regards,

Barry





May 10, 2020 2:23 PM in response to Space Ranger

IF what you are calling "spreadsheets" are actually "tables" within the same Spreadsheet Document, then a formula solution should get you closer to your goal. If they are tables in separate documents, an Applescript soluion might be possible.



In Numbers' vocabulary, "Document" and "Spreadsheet" are short forms for "Spreadsheet Document" and mean the whole document contained in a single file. That document may contain several tables, and the tables may be placed on different Sheets within the document.


This statement is NOT clear:

"I need to compare and sort which ones are currently in there and strip the ones there not out into their own column."


Can you clarify your description?


Refer to each of the tables by name.

Are you attempting to ADD items to one of the tables? Which one? What factors determine which items are to be added?

Are you attempting to remove items from one of the tables? which one? What factors determine which items are to be removed?


The version of Numbers you are using, and the version of OS X or macOS running on your computer may be significant in determining a solution as well.


OS information: Apple menu > About this Mac

Numers version: Numbers menu > About Numbers


Regards,

Barry


May 10, 2020 10:28 PM in response to Barry

macOS 10.15.4

Numbers 10.0


Yes I ended up taking two spreadsheets and taking the column I needed from each and created one sheet in one spreadsheet document with two separate tables on the one sheet.


Table 1 – Existing Inventory

Let's say it has 1500 items


Table 2 – Central Inventory

This one only has 1200 items


so we have 300 unaccounted for product serial numbers.


What I need to do is create a table with 3 or 4 columns (depending on the formula).


this New Table will start with Existing Product Serial #s Inventory and I need to compare that to the Central Inventory serial #s and determine which Existing Serial # is not in our Central Inventory. Either by marking them or showing them in a separate column.



so for example I have the following serial #s in existing

AA11223344

BB223344

CC445566

DD990011

EE554433

FF881199


but in Central Inventory it only has

AA11223344

BB223344

CC445566

DD990011



May 11, 2020 10:25 AM in response to Space Ranger

Thank you Barry and SGIII


I think that showing TRUE or FALSE is perfect, would you recommend consolidating those into one table?


that would be my intent is to either:

a) use two separate tables on will be existing inventory and then the second would be updated with central inventory, as that will receive new Product Serial Numbers as we purchase new and should dynamically update the existing inventory.



or b) combine into one table



thank you, I will try this method out

May 11, 2020 1:50 PM in response to Space Ranger

ignore 🤭 I noticed your note at the end of your post for conditional highlighting. this solution works the best as it provides a simple yes/no value and I can easily sort by is it in central inventory or not and appears to dynamically update when something new is added central inventory.


much appreciated. and definitely any resources you have on learning more about formulas with Numbers if you have any :)


How to compare differences between spreadsheets?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.