# Count in a Col depending on another column?

#### HuskyJones

##### New Member
Hi Folks
Having a brain fart......
On my "counts" sheet I want to get the number from a column in my KCPs sheet but only to be counted if cells another column in KCPs contains a specific value (T1).....
I thought this
=COUNTIFS(KCPs!\$H\$2:\$H\$10000,"T1",KCPs!\$K2:\$K10000,<>"")

(My K column is weight, My H column is Type and i want a count of T1 with weight, then i'll repeat for T2)

I know my brain is farting but can't see it for looking

Thanks ever knowing peeps

### Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

#### AlanY

##### Well-known Member
try replace "T1" with T1

#### HuskyJones

##### New Member
nope's still get the "problem with formula" message
Thanks though

#### HuskyJones

##### New Member
try replace "T1" with T1

I bet it's because my T1/T2 is a formula itself isn't it ****

#### Joe4

The issue is with your last argument.
Try:
Code:
``[COLOR=#333333]=COUNTIFS(KCPs!\$H\$2:\$H\$10000,"T1",KCPs!\$K2:\$K10000,[/COLOR][COLOR=#ff0000]"<>"[/COLOR][COLOR=#333333])[/COLOR]``
If you are looking the for specific value "T1", use quotes around that.
If you are looking for the value in cell T1, leave the quotes off. It doesn't matter if T1 is hard-coded or a formula, as long as it is not returning an error in that cell.

Last edited:

#### HuskyJones

##### New Member
the issue is with your last argument.
Try:
Rich (BB code):
``=countifs(kcps!\$h\$2:\$h\$10000,"t1",kcps!\$k2:\$k10000,"<>")``
if you are looking the for specific value "t1", use quotes around that.
If you are looking for the value in cell t1, leave the quotes off. It doesn't matter if t1 is hard-coded or a formula, as long as it is not returning an error in that cell.

thank you joe you are my saviour!!!!!

deleted

Last edited:

You are welcome.

Replies
6
Views
265
Replies
2
Views
130
Replies
11
Views
315
Replies
6
Views
284
Replies
4
Views
343

1,195,633
Messages
6,010,818
Members
441,569
Latest member
PeggyLee

### 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.

### Which adblocker are you using?

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

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