Find unique rows with sumproduct

Bandito1

Board Regular
Joined
Oct 18, 2018
Messages
233
Office Version
  1. 2016
Platform
  1. Windows
Hello all,

I got 2 sheets (data(1) and data(2)

Data(1) gathers data from data(2)

It keeps track of how many files are returned.

Now i would like to see unique returns.
Since total returns count the total.

Batch 3 in data(2) has been retoured 2 times but it should count for only 1.
If only one x is in the line it should count 1 and not sum up the x.

Can't manage to get it working since now it shows "1" at unique returns while it should show "2"

Dashboard_test.xlsm
BCDEF
12022
2MonthRetour ARetour BTotal returnsUnique returns
3January
4February
5March
6April
7May
8June
9July
10August
11September
12October2131
13November
14December
15Total21
data(1)
Cell Formulas
RangeFormula
C12C12=SUMPRODUCT(('data(2)'!$B:$B>=B12)*('data(2)'!$B:$B<=EOMONTH(B12,0))*('data(2)'!$C:$C="x"))
D12D12=SUMPRODUCT(('data(2)'!$B:$B>=B12)*('data(2)'!$B:$B<=EOMONTH(B12,0))*('data(2)'!$H:$H="x"))
E12E12=SUM(C12:D12)
F12F12=SUMPRODUCT(('data(2)'!$B:$B>=B12)*('data(2)'!$B:$B<=EOMONTH(B12,0))*('data(2)'!$C:$C="x")*('data(2)'!$H:$H="x"))
B3:B14B3=DATE($B$1,ROWS($1:1),1)
C15:D15C15=SUM(C3:C14)


Dashboard_test.xlsm
ABCDEFH
3BatchRetour AReturn ARetour B
4114-okt-22
524-okt-22x
634-okt-22xx
data(2)
 
Hope this makes more clear.

In worksheet Dashboard, in column O it should count if there is an "x" somewhere in the line of the batch number.
If there is 1 "x" or more it should count for 1.

If there are no "x" in the row it should count as 0.

So in the sample below (where i only look in column N and S for "x") the number in dashboard under column O should be 6.
There are 6 rows with 1 "x" in it.
The first row has an "x" in N and an "x" in S but should be counted as 1.

At this moment the column O in dashboard shows the number 3. Seems like it only looks in column N..


Dashboard.xlsm
B
12022
BMR data (2)

Dashboard.xlsm
BCDEFGHIJKLMNO
2MonthRetour MRetour ERetour PRetour PSRetour WHTotal returnsRetour M + E unique
BMR data (2)

Dashboard.xlsm
BCDEFGHIJKLMNO
14December34330133
BMR data (2)
Cell Formulas
RangeFormula
B14B14=DATE($B$1,ROWS($1:12),1)
I14I14=SUMPRODUCT(('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L>=B14)*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L<=EOMONTH(B14,0))*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$N:$N="x"))
J14J14=SUMPRODUCT(('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L>=B14)*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L<=EOMONTH(B14,0))*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$S:$S="x"))
K14K14=SUMPRODUCT(('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L>=B14)*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L<=EOMONTH(B14,0))*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$X:$X="x"))
L14L14=SUMPRODUCT(('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L>=B14)*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L<=EOMONTH(B14,0))*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$AC:$AC="x"))
M14M14=SUMPRODUCT(('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L>=B14)*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L<=EOMONTH(B14,0))*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$AH:$AH="x"))
N14N14=SUM(I14:M14)
O14O14=SUMPRODUCT(SIGN(('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L>=B14)*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L<=EOMONTH(B14,0)*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$N:$N="x")+('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$S:$S="x"))))


Tracker QA on the floor New.xlsm
LNOPQSTUVXYZAAACADAEAFAHAIAJAK
723Retour MRetour ERetour PReturn PSReturn WH
724RetourDateReturnDateRetourDateReturnDateRetourDateReturnDateRetourdateReturnDateRetourDateReturnDate
7252-dec-22x01-dec-22x03-dec-22x30-nov-22x1-dec-22x30-nov-22x01-dec-22
7261-dec-22x30-nov-22x01-dec-22
7274-dec-22x3-dec-22x4-dec-22x29-nov-22x30-nov-22x29-nov-22x30-nov-22
7281-dec-22
7291-dec-22
7302-dec-22x03-dec-225-dec-22
7312-dec-22x01-dec-22x02-dec-22
7322-dec-22
7335-dec-22x3-dec-22x5-dec-22
7345-dec-22x04-dec-22x05-dec-22
7353-dec-22x02-dec-22x02-dec-22
7362-dec-22x2-dec-22x2-dec-22
7374-dec-22
7384-dec-22
7394-dec-22
7405-dec-22
7415-dec-22
7424-dec-22x04-dec-22x04-dec-22
Tracker QA on the Floor
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
You have one of the brackets in the wrong place, it should be
Excel Formula:
=SUMPRODUCT(SIGN(('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L>=B14)*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L<=EOMONTH(B14,0))*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$N:$N="x")+('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$S:$S="x")))
 
Upvote 0
Still wrong number come out :(
But i found the cause of it.
To bad no solution yet.

The source file is a big file (725 rows).
There are blanks in it and lots of other dates.

It seems like (i tested by deleting everything except the values december in column L) this is causing the wrong numbers.

How come and how can i solve?

Excel Formula:
=SUMPRODUCT(('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L>=B14)*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L<=EOMONTH(B14,0))*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$N:$N="x"))

This gives the right number and it doesn't matter the big size file and blanks and other stuff.

Excel Formula:
=SUMPRODUCT(SIGN(('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L>=B14)*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L<=EOMONTH(B14,0))*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$N:$N="x")+('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$S:$S="x")))

Can't handle the blanks and other dates in the big excell file
It should only check the "x" behind december dates in column L but it seems like it counts far more
 
Upvote 0
How about
Excel Formula:
=SUMPRODUCT(SIGN(('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L>=B14)*('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$L:$L<=EOMONTH(B14,0))*(('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$N:$N="x")+('[Tracker QA on the floor New.xlsm]Tracker QA on the Floor'!$S:$S="x"))))
 
Upvote 0
Solution
Wauw that's it!
It works!

Thank you very much for your patients and time!
 
Upvote 0
Glad it's sorted & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

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