Reputation: 11
So I have a spreadsheet with products listed. There is a product ID which represents different colors and sizes of the product. There is also a column for price.
I want to ensure that all the products with the same ID have the same price and there is no variation.
How do I group all cells with the same ID, and then run a check to ensure all those IDss have the same value in the price column?
I would prefer not to use VBA, if possible.
Upvotes: 0
Views: 4915
Reputation: 42384
Given this example spreadsheet:
=OR(A2<>A1,B2=B1)
FALSE
indicate values where the Product ID matches the Product ID above but the price doesn't match the price above.The formula returns TRUE
if either the Product ID of the current row is different than the Product ID of the row above (which means the prices don't need to match) or the price of the current row is the same as the price of the previous row (if the prices match, it can't be invalid). Otherwise, it returns FALSE
.
Upvotes: 3
Reputation: 1138
Depending on the size of your dataset and how often you want to do this, you might manage to do this manually by using Excel's "Filter" capability. This is a basic solution as I am not sure of your needs or experience:
Click anywhere in your dataset
Under the "Data" tab, click Filter. Your column names should have a dropdown button on them.
Click the dropdown button on your ID field, and only select the ID you want to evaluate.
Click the dropdown button on your price field, if there are any different values showing then they are not all the same.
Upvotes: 1