Need Help In COUNTIF Function

Santosh080

Board Regular
Joined
Jul 15, 2016
Messages
77
Office Version
  1. 2021
Platform
  1. Windows
hello friends
Need help with count function. I have a excel file data like this,

PlacePlace PinName of Items
AAA
125​
PEN
CCC
254​
KEY
AAA
146​
PEN
TTT
142​
PENCIL
JJJ
547​
ERASER
AAA
125​
PEN
AAA
125​
KEY
DDD
147​
GOLD
DDD
147​
KEY​

i need data like this,

NamePlace PinNumber of items
AAA
125​
???


In "Number of item" i want number of items that must match "Name", "Place Pin" and " Name of Item".

Like i want to count where Place =AAA, Place Pin=125, Name Item =Pen and Key. Here the result will be 3.

please help.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
why 3
must match "Name", "Place Pin" and " Name of Item".

AAA 125 Pen = 2
AAA 146 Pen = 1

if you want 3 - then are you ignoring the Place PIN

COUNTIFS()

Book3
ABCDEFGHIJ
1PlacePlace PinName of ItemsPlacePlace PinNameCount
2AAA125PENAAA125PEN2
3CCC254KEYCCC254KEY1
4AAA146PENAAA146PEN1
5TTT142PENCILTTT142PENCIL1
6JJJ547ERASERJJJ547ERASER1
7AAA125PENAAA125KEY1
8AAA125KEYDDDGOLD1
9DDDGOLD014700
10147DDDKEY1
11DDDKEY
12147
Sheet1
Cell Formulas
RangeFormula
F2:H10F2=UNIQUE(A2:C12)
J2:J10J2=COUNTIFS($A$2:$A$12,F2,B$2:$B$12,G2,C$2:$C$12,H2)
Dynamic array formulas.
 
Upvote 0
Hello

Excel Formula:
=SUM(COUNTIFS(Table1[Place],"AAA",Table1[Place Pin],125,Table1[Name of Items],{"Pen","Key"}))
 
Upvote 0
why 3


AAA 125 Pen = 2
AAA 146 Pen = 1

if you want 3 - then are you ignoring the Place PIN

COUNTIFS()

Book3
ABCDEFGHIJ
1PlacePlace PinName of ItemsPlacePlace PinNameCount
2AAA125PENAAA125PEN2
3CCC254KEYCCC254KEY1
4AAA146PENAAA146PEN1
5TTT142PENCILTTT142PENCIL1
6JJJ547ERASERJJJ547ERASER1
7AAA125PENAAA125KEY1
8AAA125KEYDDDGOLD1
9DDDGOLD014700
10147DDDKEY1
11DDDKEY
12147
Sheet1
Cell Formulas
RangeFormula
F2:H10F2=UNIQUE(A2:C12)
J2:J10J2=COUNTIFS($A$2:$A$12,F2,B$2:$B$12,G2,C$2:$C$12,H2)
Dynamic array formulas.
There are some conditions like Place=AAA, PIN=125 and Items are Pen & Key. I want Number of items if all conditions satisfy. Here in above example the result is three 3 because

AAA 125 PEN
AAA 125 PEN
AAA 125 KEY


Here i do not want Pin= 146


I want the count result in another sheet like i mentioned above not side of the data sheet.
 
Upvote 0
I don't know. In my worksheet it counts to three.
Try to enter the formula with CTRL+SHIFT+ENTER.
 
Upvote 0
can you give some expected results .....
OR is it ONLY AAA 125 you want a count for

I put at side for easy display, pretty easy to add to another sheet

here it is in a separate sheet

This time just counting the place and place pin

Book3
ABC
1PlacePlace PinName of Items
2AAA125PEN
3CCC254KEY
4AAA146PEN
5TTT142PENCIL
6JJJ547ERASER
7AAA125PEN
8AAA125KEY
9DDD147GOLD
10DDD147KEY
11
Sheet1


Book3
ABCDE
1PlacePlace PinNameCount
2AAA1253
3CCC2541
4AAA1461
5TTT1421
6JJJ5471
7DDD1472
800
9000
100
Sheet2
Cell Formulas
RangeFormula
A2:B9A2=UNIQUE(Sheet1!A2:B12)
E2:E10E2=COUNTIFS(Sheet1!$A$2:$A$13,A2,Sheet1!$B$2:$B$13,B2)
Dynamic array formulas.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,373
Messages
6,124,555
Members
449,170
Latest member
Gkiller

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