Count per Date and Group

mucah!t

Well-known Member
Joined
Jun 27, 2009
Messages
593
Hi all,

Is it possible to count the C's based on the criteria given in J4:L4?

Excel Workbook
ABCDEFGHIJKL
3alfaalfaalfabravobravocharliecharlieGROUPFROMTILL
41-JanDFDFDFGHGHDNDNALFA5-Jan11-Jan
52-JanDFDFDFCGHDNDN
63-JanDFDFDFRESULT =4
74-Jan
85-JanDNDNDNGHGHGHGH
96-JanDNCDNDNCGHGH
107-JanDNDNDNDNDN
118-JanCDNCDNDN
129-JanDNDNGHGH
1310-JanDNDNDNC
1411-JanGHGHCDFDF
1512-JanGHGHGHDGDGDFDF
1613-JanDGDGDFDF
1714-JanCDF
1815-JanGHGHGHDFDFDNDN
1916-JanDNDNDNDFDFDNDN
2017-JanDNDNDNDNDN
2118-JanDNDNDNDNDNCDN
2219-JanDNDNDNDNC
2320-JanDNDNDNDNDN
2421-JanDNDNGHGH
2522-JanDGDGDGGHGH
2623-JanDGDGDG
Sheet1
Excel 2003Worksheet
</TR></TBODY>
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hello, Try

K4, Control+Shift+Enter, not just Enter

=SUM(IF(B3:H3=J4,IF(A4:A26>=K4,IF(A4:A26<=L4,IF(B4:H26="C",1)))))
 
Upvote 0
Control+shift=enter, not just enter:

=SUM(IF($A$4:$A$26>=K4,IF($A$4:$A$26<=L4,IF($B$3:$H$3=J4,($B$4:$H$26="C")+0))))
 
Upvote 0
Wow great, thanks guys,

I got still one thing though.
Is it possible to count all C's as 8 and to sum all C's followed by a number [like C2 or C4]?

Excel Workbook
ABCDEFGHIJKL
3alfaalfaalfabravobravocharliecharlieGROUPFROMTILL
41-JanDFDFDFGHGHDNDNALFA5-Jan11-Jan
52-JanDFDFDFCGHDNDN
63-JanDFDFDFRESULT =22
74-Jan
85-JanDNDNDNGHGHGHGH
96-JanDNC2DNDNCGHGH
107-JanDNDNDNDNDN
118-JanC4DNCDNDN
129-JanDNDNGHGH
1310-JanDNDNDNC
1411-JanGHGHCDFDF
1512-JanGHGHGHDGDGDFDF
1613-JanDGDGDFDF
1714-JanCDF
1815-JanGHGHGHDFDFDNDN
1916-JanDNDNDNDFDFDNDN
2017-JanDNDNDNDNDN
2118-JanDNDNDNDNDNCDN
2219-JanDNDNDNDNC
2320-JanDNDNDNDNDN
2421-JanDNDNGHGH
2522-JanDGDGDGGHGH
2623-JanDGDGDG
Sheet1
Excel
 
Upvote 0
The following formula works, but gives an error when the range also includes codes like "CD" or "CN".
Any ideas

ps. the formula takes about 20seconds to calculate :(
#VALUE!
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}. Note: Do not try and enter these manually yourself
 
Last edited:
Upvote 0
Although not shown in the example, the range also includes codes like "CD" and "CA". This results in an error.
 
Upvote 0
Although not shown in the example, the range also includes codes like "CD" and "CA". This results in an error.

Mucahit:

The question is what you want:

Counting C stand-alone or not? The formula I suggested does not include CD and CA at all.
 
Upvote 0
I'd like C's to be counted as 8
C2's C4's etc to sum only the digits
and ignore codes like CD CA etc.

if this is impossible or too difficult

then I'd like only the C's with an digit to be summed.
 
Upvote 0
I'd like C's to be counted as 8
C2's C4's etc to sum only the digits
and ignore codes like CD CA etc.

if this is impossible or too difficult

then I'd like only the C's with an digit to be summed.

Thus:

A stand-alone C ---> 1

Something like C2 ---> 2

Something like CD ---> 0

Right?
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,875
Members
452,949
Latest member
Dupuhini

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