Nov 17 2022 11:00 AM
Hi all,
I am trying to sort a web store for my company. I have 504 orders with various products/quantities of products ordered. What I'd like to do is sort the orders by sum of SKU, and subsequently sort those orders by product alphabetically. So, e.g. all the orders with one item would show up first, and then orders with two, and so on, with the additional criteria that the 1-SKU orders (and then 2-SKU, etc.) are listed with products alphabetically.
Hopefully this makes sense and I appreciate all feedback, thanks.
Nov 18 2022 12:45 AM
@Ehrnstrom This makes sense if each order has one row per SKU; such a row would be referred to as a line item. But calculating the sum of SKUs does not make sense; I believe you want to count (rather than sum) the SKUs ... or equivalently, count the line items for each order.
So if your worksheet includes data like this... (Your data might be ordered by OrderID, but as you will see, this is not required for the calculation.)
...you should add a column that counts the number of rows per order. The formula in this column could be (e.g., in row 2):
=COUNTIF( $A$2:$A$9999, $A2 )
Copy that formula down through all your data rows.
Then the required sort columns for all the data are:
Nov 19 2022 09:06 AM
@SnowMan55 thank you! This was the breakthrough I needed!