Count if function

vmjan02

Well-known Member
Joined
Aug 15, 2012
Messages
1,062
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
I have this data and i am using count if function, it's not giving me the required output, any suggestion.
simple need to count then names only if the amount is available as 1 else it will be blank
Excel Formula:
=IF(B2<>"",COUNTIF($A$2:A2,A2),"")

NamesAmountCount functionActual Output
ABG12.50
1​
correct
ABG30.42
2​
ABG
AMFI
AMFI2.44
2​
this has to be 1
APV0.34
1​
correct
APV5.40
2​
AVENDUS
BANK OF MAHARASHTRA
BANK OF MAHARASHTRA
BANK OF MAHARASHTRA
BANK OF MAHARASHTRA
CEPT0.68
1​
correct
CHATTISGARH GOVERNMENT
CHATTISGARH GOVERNMENT2.63
2​
this has to be 1
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Perhaps this?
test.xlsm
ABC
1NamesAmountCount function
2ABG12.501
3ABG30.422
4ABG 
5AMFI 
6AMFI2.441
7APV0.341
8APV5.402
9AVENDUS 
10BANK OF MAHARASHTRA 
11BANK OF MAHARASHTRA 
12BANK OF MAHARASHTRA 
13BANK OF MAHARASHTRA 
14CEPT0.681
15CHATTISGARH GOVERNMENT 
16CHATTISGARH GOVERNMENT2.631
Sheet1
Cell Formulas
RangeFormula
C2:C16C2=IF(B2<>"",COUNTIFS($B$2:B2,"<>",$A$2:A2,A2),"")
 
Upvote 0
Solution
=IF(B2<>"",COUNTIFS($B$2:B2,"<>",$A$2:A2,A2),"")
tried it, but not sure as i am not getting the same result

NamesAmountCount
ABG12.50
1​
ABG30.42
2​
ABG
AMFI
AMFI2.44
2​
APV0.34
1​
APV5.40
2​
AVENDUS
BANK OF MAHARASHTRA
BANK OF MAHARASHTRA
BANK OF MAHARASHTRA
BANK OF MAHARASHTRA
CEPT0.68
1​
CHATTISGARH GOVERNMENT
CHATTISGARH GOVERNMENT2.63
2​
 
Upvote 0
Check cells B5 (the first AMFI amount) and B15 (the first CHATTISGARH GOVERNMENT amount) and ensure that both those cells are truly empty. If there's a " " (space) in either of those cells, you'd get that result.

I see since I've been typing that you've found a workable solution.
 
Upvote 0
Check cells B5 (the first AMFI amount) and B15 (the first CHATTISGARH GOVERNMENT amount) and ensure that both those cells are truly empty. If there's a " " (space) in either of those cells, you'd get that result.

I see since I've been typing that you've found a workable solution.
yes it was completely empty, i think ia using 365 that's why it did not took the original function that you shared, but took >0
 
Upvote 0
Understood - although I think you should mark your post #4 as the actual solution?
Regards
Kevin
 
Upvote 0

Forum statistics

Threads
1,216,119
Messages
6,128,941
Members
449,480
Latest member
yesitisasport

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