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
 

Some videos you may like

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Greenwald

New Member
Joined
Jan 4, 2015
Messages
1
=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?
 

7corona7

New Member
Joined
Jan 4, 2015
Messages
6
=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.
 

XOR LX

Well-known Member
Joined
Jul 2, 2012
Messages
4,517
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
 

7corona7

New Member
Joined
Jan 4, 2015
Messages
6
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! =)
 

Watch MrExcel Video

Forum statistics

Threads
1,123,517
Messages
5,602,127
Members
414,505
Latest member
quoctrungvu99

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
Top