Count Visible Negative Cells, but not duplicates???

natheplas

Board Regular
Joined
Aug 28, 2016
Messages
97
Hi All,

Really struggling with this one.

I've got a formula that counts only the visible filtered negative numbers, however, it gets more complex as I don't want it to count it if it's a duplicate in relation to a despatch number.

Please see example table below.

My current formula counts the filtered table minuses on column E . So it would count 32. However, this is wrong. I need the formula to look at the order number and/or despatch number and not count it if it's a duplicate. For example it should return the number 4.

I don't know where to start with this? Maybe you could count each visible minus number on column e, in relation to every unique visible dispatch number?

Please help.



Order No. Despatch no.
[TABLE="width: 362"]
<tbody>[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124583[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-15[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124583[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-15[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124583[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-15[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124583[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-15[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124583[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-15[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124583[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-15[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124583[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-15[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124583[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-15[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124583[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-15[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124583[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-15[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124583[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-15[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124583[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-15[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124583[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-15[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124583[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-15[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124636[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-16[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]124636[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-16[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125210[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-24[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125210[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-24[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125210[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-24[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125210[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-24[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125210[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-24[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125210[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-24[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125210[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-24[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125210[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-24[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125210[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-24[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125210[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-24[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125210[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-24[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125210[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-24[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125661[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-35[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125661[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-35[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125661[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-35[/TD]
[/TR]
[TR]
[TD]A/C[/TD]
[TD="align: right"]101631[/TD]
[TD="align: right"]125661[/TD]
[TD]Company Name[/TD]
[TD="align: right"]-35[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Try:

Code:
=SUM(SIGN(FREQUENCY(IF(SUBTOTAL(104,OFFSET(E2,ROW(E2:E50)-ROW(E2),0))<0,MATCH(B2:B50&"|"&C2:C50,B2:B50&"|"&C2:C50,0)),ROW(B2:B50)-ROW(B2)+1)))

confirmed with Control+Shift+Enter.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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