Count cells in a table only for specific columns

7corona7

New Member
Joined
Jan 4, 2015
Messages
6
Hey!

I am stuck on a simple yet seemingly difficult task for excel. All I want to do is count the number of cells for specific columns, yet I haven't found a formula which could work.

j
n
n
j
j
0
0
1
1
0
1
0
1
99
0
0
1
1
1
1
1
0
0
1
1
99
0
0
1
1
0
99
1
1
0

<tbody>
</tbody>


I need to count the columns for "j" and "n" separately (and add them together), but only for the numbers <2. So for "j" I should receive a result of 5+5+6=16 and for "n" 5+6=11.
Does anybody have an insight into this problem?

Thanks
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
=COUNTIF(A2:A7,"<2") and replace with each specific range.

Is that good enough or do you need to automate the addition of columns as well?
 
Upvote 0
=COUNTIF(A2:A7,"<2") and replace with each specific range.

Is that good enough or do you need to automate the addition of columns as well?

thanks, so there is no way around of doing this manually for each column? (I have a large datasheet)

and yes I would need the total sum of all of the "j" and "n" counts. Which means I guess I could just use the SUM formula to add all the values.
 
Upvote 0
Hi.

Assuming the table as you give it is in A1:E7 (with headers in row 1):

=SUMPRODUCT((A1:E1="j")*(A2:E7<2))

Change the "j" to "n" as desired.

Note that, since your example did not include any blank cells, I have assumed that this will always be the case and so have not accounted for this possibility in the above formula.

Regards
 
Upvote 0
Hi.

Assuming the table as you give it is in A1:E7 (with headers in row 1):

=SUMPRODUCT((A1:E1="j")*(A2:E7<2))

Change the "j" to "n" as desired.

Note that, since your example did not include any blank cells, I have assumed that this will always be the case and so have not accounted for this possibility in the above formula.

Regards

this is an awfully late responde, but thanks this is exactly what I wanted! =)
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,037
Members
448,543
Latest member
MartinLarkin

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