Counting Table

Steve 1962

Active Member
Joined
Jan 3, 2006
Messages
346
Office Version
  1. 365
Platform
  1. Windows
Hi

I did repost this post but I'm not sure that it came through, so just posting again just in case it didn't work the first time. Apologies if this is a double-up.

I have added an additional column C (Exception) which has either a 1 or 2 or can be some other number.

I would like the current counting table that we now have working fine to now only count the entries if they are anything but 1 in the "Exception" column.
Eg: Count as normal but do not count those cells which have a 1 in them.

Thanks

Book1
ABCDEFGHIJK
1DateReferenceExceptionStartEndReference5C42111234678
21/04/20205C421CairoNew YorkAllowed LocationsBostonCairoBostonAuckland
31/04/20205C421BostonNew YorkNew YorkAucklandNew YorkLas Vegas
41/04/20205C421BostonNew YorkCalgaryNew YorkCairoLos Angeles
51/04/20201111DallasBoston
61/04/20205671BostonCalgary
72/04/20202341BostonCairoShould Read - 5C42111234678
82/04/20202341Los AngelesBoston1/04/20201100
92/04/20205671BostonBoston2/04/20200110
102/04/20205671BostonNew York3/04/20200203
112/04/20201111BostonNew York4/04/20200010
122/04/20205672BostonNew York
133/04/20201112New YorkNew York
143/04/20201112New YorkLos Angeles
153/04/20201112Las VegasNew York
163/04/20206782New YorkCairo
173/04/20206782New YorkCairo
183/04/20206781SeattleCairo
194/04/20201111New YorkCairo
204/04/20201112New YorkCairo
214/04/20205672New YorkBoston
224/04/20202342AucklandBoston
234/04/20202372CairoBoston
244/04/20202372AucklandBoston
Mr Excel
Cell Formulas
RangeFormula
H8:K11H8{=SUM(--(FREQUENCY(IF(ISNA(MATCH($D$2:$E$24,H$2:H$4,0))*ISNUMBER(MATCH($A$2:$A$24,$G8,0))*ISNUMBER(MATCH($B$2:$B$24,H$1,0)),ROW($A$2:$A$24)-ROW($A$2)+1,""),ROW($A$2:$A$24)-ROW($A$2)+1)>0))}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I think that this is what you're asking for, in H8, remember to confirm the array with Ctrl Shift Enter

=SUM(--(FREQUENCY(IF(ISNA(MATCH($D$2:$E$24,H$2:H$4,0))*ISNUMBER(MATCH($A$2:$A$24,$G8,0))*ISNUMBER(MATCH($B$2:$B$24,H$1,0))*($C$2:$C$24<>1),ROW($A$2:$A$24)-ROW($A$2)+1,""),ROW($A$2:$A$24)-ROW($A$2)+1)>0))
 
Upvote 0
In continuation of the previous / separate post by you, you may use below Array Formula (Ctrl+Shift+Enter) - this adds another condition of "($C$2:$C$24<>1)" to my earlier formula, to exclude column C cells with 1, and as already stated by jasonb:

=SUM(--(FREQUENCY(IF(ISNA(MATCH($D$2:$E$24,H$2:H$4,0))*ISNUMBER(MATCH($A$2:$A$24,$G8,0))*ISNUMBER(MATCH($B$2:$B$24,H$1,0))*($C$2:$C$24<>1),ROW($A$2:$A$24)-ROW($A$2)+1,""),ROW($A$2:$A$24)-ROW($A$2)+1)>0))
 
Upvote 0
Hey thanks very much Amit & Jasonb.

Works fine. You guys are smart.

All the best.
 
Upvote 0
I thought that the formula looked a bit clumsy for the task it performs, it took me a while to figure out the logic in order to clean it up a bit.

Same results, no need to array confirm.

=SUMPRODUCT(($A$2:$A$24=$G8)*($B$2:$B$24=H$1)*($C$2:$C$24<>1)*((ISNA(MATCH($D$2:$D$24,H$2:H$4,0))+ISNA(MATCH($E$2:$E$24,H$2:H$4,0)))>0))
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,692
Members
448,979
Latest member
DET4492

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