Sum based on unique values in separate column without removing duplicates

jsimp78

New Member
Joined
Feb 1, 2017
Messages
2
This spreadsheet contains order information. When someone places an order, each item in their order is displayed on multiple rows. There could be one item, or many. You can see how Order #5383 had 2 items, thus two rows. I've found a formula (=SUMPRODUCT((J3:J10000<>"")/COUNTIF(J3:J10000,J3:J10000&""))) that will display the number of unique orders in Column J (displayed in J1). There are 219 rows of data, but only 118 orders. I know that 118 is the correct number, as if I simply "remove duplicates" from the Data Tab using the Order Number column, it gives me the same number. In Column Z I'm trying to display only the dollar amount that the 118 orders equals. What I mean, is, going back to that order #5383 mentioned earlier - it has $14.69 displayed twice in the "Order Total" column (because there were 2 items in that order - note, each item was a different amount, and $14.69 was the order total, not each item amount), and therefore, the total dollar amount at the top ($14831.32 - which is just a subtotal formula) is adding the order total multiple times. I expect the total to be $6444.72, as if I were to simply "remove duplicates" from the data tab based on Column J, it only adds the amounts one time. I'd like to use a formula instead of the "remove duplicates" button, as I need all of the info in the spread sheet, and "removing duplicates" becomes troublesome for me.

Important - if someone is able to come up with a formula, please note that there might be blanks, and I need the formula to NOT include blanks, and only want it to calculate displayed information (if that's possible). I'll live with it if the formula can't decipher if the information is filtered.

Also, I won't be the only one having to use this form, so I'd like the result to be as simple as possible (simply copy and paste a formula would be ideal), and not multiple steps of inserting columns, etc.

I hope this all makes sense. I sincerely appreciate any help anyone can provide!
excel%20screen%20shot_zpsstoue4bk.jpg
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Maybe something like this.
This is an array formula and must be entered with CTRL-SHIFT-ENTER (command-return on MAC).
Excel Workbook
ABCD
1OrderTotal
2537430.24122.69
3537730.24
4538314.69
5538314.69
6538847.52
Sheet
 
Upvote 0

Forum statistics

Threads
1,223,244
Messages
6,170,976
Members
452,372
Latest member
Natalie18

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top