Unique or Sumproduct or something else?

Montanes

New Member
Joined
Aug 18, 2016
Messages
42
Office Version
  1. 365
Platform
  1. Windows
So I have a lot of data and someone has changed how it is imported!

I needed to find how many different orders were taken by a salesperson in the month so ran this

COUNTIFS(Dels!$O:$O,"BOB",Dels!$C:$C,">=01/08/2023",Dels!$C:$C,"<=31/08/2023",Dels!$H:$H,">0.00")

which ran perfectly as all orders were delivered and had a delivery cost in column H. Given that the order was only delivered once, it produced the amount of orders that were placed.

Now someone has changed the data criteria and column H no longer shows a delivery cost, its just always 0.00!

Column A however may hold a solution.

You see, if a customer orders 3 different products it is shown over 3 different lines or 4 products over 4 lines etc hence why I counted the deliveries which only appeared once per order.

Column A does have a sales code but its the same code for all the lines within the order. So if a customer orders 3 products, the 3 lines have the same number in column A.

This means I could somehow replace the last part of my original formula for column H to count the numbers in column A but only count the duplicates once or remove the duplicates or something.

Jeez I hope that all makes sense!

Thank-you in advance for any assistance.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
So I have a lot of data and someone has changed how it is imported!

I needed to find how many different orders were taken by a salesperson in the month so ran this

COUNTIFS(Dels!$O:$O,"BOB",Dels!$C:$C,">=01/08/2023",Dels!$C:$C,"<=31/08/2023",Dels!$H:$H,">0.00")

which ran perfectly as all orders were delivered and had a delivery cost in column H. Given that the order was only delivered once, it produced the amount of orders that were placed.

Now someone has changed the data criteria and column H no longer shows a delivery cost, its just always 0.00!

Column A however may hold a solution.

You see, if a customer orders 3 different products it is shown over 3 different lines or 4 products over 4 lines etc hence why I counted the deliveries which only appeared once per order.

Column A does have a sales code but its the same code for all the lines within the order. So if a customer orders 3 products, the 3 lines have the same number in column A.

This means I could somehow replace the last part of my original formula for column H to count the numbers in column A but only count the duplicates once or remove the duplicates or something.

Jeez I hope that all makes sense!

Thank-you in advance for any assistance.
Can you use XL2BB to post the data in a mini-sheet please?
 
Upvote 0
How about
Excel Formula:
=ROWS(UNIQUE(FILTER(Dels!$A2:$A10000,(Dels!$O2:$O10000="BOB")*(Dels!$C2:$C10000>="01/08/2023")*(Dels!$C2:$C10000<="31/08/2023"))))
 
Upvote 0
How about
Excel Formula:
=ROWS(UNIQUE(FILTER(Dels!$A2:$A10000,(Dels!$O2:$O10000="BOB")*(Dels!$C2:$C10000>="01/08/2023")*(Dels!$C2:$C10000<="31/08/2023"))))
That returns #CALC! - empty arrays are not supported
 
Upvote 0
In that case can you post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Book1
ABCDEFGHIJKLMNO
1Document NumberItem NoPosting DateLocationQuantitySales AmountCost AmountHaulageGibberishSourceEntryInvoice NoMeasureYet Another CodeSalesperson
2D123456Socks05/07/2023Manchester5£100.00£12.50£0.000PDQ15689123456INV11111EACLISA
3D123456Shoes05/07/2023Manchester5£500.00£62.50£0.000PDQ15689123457INV11111EACLISA
4D123456Laces05/07/2023Manchester5£50.00£6.25£0.000PDQ15689123458INV11111METLISA
5D123457Shoes01/08/2023London1£100.00£12.50£0.000PDQ16589123459INV11112EACBOB
6D123457Laces01/08/2023London1£10.00£1.25£0.000PDQ16589123460INV11112METBOB
7D123458Laces02/08/2023Birmingham3£30.00£3.75£0.003PDQ15877123461INV11113METPAULINE
8D123459Socks02/08/2023Birmingham24£480.00£60.00£0.001PDQ25666123462INV11114EACJOE
9D123459Shoes02/08/2023Birmingham24£2,400.00£300.00£0.001PDQ25666123463INV11114EACJOE
10D123459Laces02/08/2023Manchester24£240.00£30.00£0.001PDQ25666123464INV11114METJOE
11D123459Box02/08/2023Manchester24£120.00£15.00£0.001PDQ25666123465INV11114EACJOE
12D123460Shoes14/08/2023London12£1,200.00£150.00£0.002PDQ14986123466INV11115EACBOB
13D123460Laces14/08/2023London12£120.00£15.00£0.002PDQ14986123467INV11115METBOB
14D123461Laces19/08/2023London5£50.00£6.25£0.001PDQ24444123468INV11116METLISA
15D123462Shoes28/08/2023Manchester3£300.00£37.50£0.003PDQ13985123469INV11117EACJOE
16D123462Laces28/08/2023Manchester3£30.00£3.75£0.003PDQ13985123470INV11117METJOE
Dels
 
Upvote 0
Thanks for that, how about
Excel Formula:
=ROWS(UNIQUE(FILTER(Dels!$A2:$A10000,(Dels!$O2:$O10000="BOB")*(Dels!$C2:$C10000>=DATE(2023,8,1))*(Dels!$C2:$C10000<=DATE(2023,8,31)))))
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,177
Members
452,615
Latest member
bogeys2birdies

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