#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 989
Default Counting

I have a column where I'm using IF statements to return a value from another
column if certain conditions are meet and "" otherwise. Previously I had
manually enter that information and then did a count of any cell in that
column, using COUNTA, that contain a value. But, since changing to an if
statement, COUNTA is counting every cell because every cell now has an if
statement in it. I want to count cells only when the if statement returns a
value other than "" (blank).

How do I do this?

Here's my data
ColA ColB
1A =if(right(A1,1)="A",A1,"")
2C =if(right(A1,1)="A",A1,"")
3D =if(right(A1,1)="A",A1,"")
4E =if(right(A1,1)="A",A1,"")
5W =if(right(A1,1)="A",A1,"")
=countA(b1:b5)


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 989
Default Counting

I should add that the IF statement will not necessarily return the same value
even though that is the case in my example.

"Mark" wrote:

I have a column where I'm using IF statements to return a value from another
column if certain conditions are meet and "" otherwise. Previously I had
manually enter that information and then did a count of any cell in that
column, using COUNTA, that contain a value. But, since changing to an if
statement, COUNTA is counting every cell because every cell now has an if
statement in it. I want to count cells only when the if statement returns a
value other than "" (blank).

How do I do this?

Here's my data
ColA ColB
1A =if(right(A1,1)="A",A1,"")
2C =if(right(A1,1)="A",A1,"")
3D =if(right(A1,1)="A",A1,"")
4E =if(right(A1,1)="A",A1,"")
5W =if(right(A1,1)="A",A1,"")
=countA(b1:b5)


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 989
Default Counting

Error in formula corrected.


ColA ColB
1A =if(right(A1,1)="A",A1,"")
2C =if(right(A2,1)="A",A1,"")
3D =if(right(A3,1)="A",A1,"")
4E =if(right(A4,1)="A",A1,"")
5W =if(right(A5,1)="A",A1,"")
=countA(b1:b5)



"Mark" wrote:

I have a column where I'm using IF statements to return a value from another
column if certain conditions are meet and "" otherwise. Previously I had
manually enter that information and then did a count of any cell in that
column, using COUNTA, that contain a value. But, since changing to an if
statement, COUNTA is counting every cell because every cell now has an if
statement in it. I want to count cells only when the if statement returns a
value other than "" (blank).

How do I do this?

Here's my data
ColA ColB
1A =if(right(A1,1)="A",A1,"")
2C =if(right(A1,1)="A",A1,"")
3D =if(right(A1,1)="A",A1,"")
4E =if(right(A1,1)="A",A1,"")
5W =if(right(A1,1)="A",A1,"")
=countA(b1:b5)


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 527
Default Counting

Mark

Use the countif function

=COUNTIF(B2:B6,A1)

Regards
Peter

"Mark" wrote:

Error in formula corrected.


ColA ColB
1A =if(right(A1,1)="A",A1,"")
2C =if(right(A2,1)="A",A1,"")
3D =if(right(A3,1)="A",A1,"")
4E =if(right(A4,1)="A",A1,"")
5W =if(right(A5,1)="A",A1,"")
=countA(b1:b5)


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Counting

=counta() will count cells with formulas--even those that evaluate to "".

One more if you're trying to count the number of values in A1:A5 that end with
A.

=countif(a1:a5,"*a")

Mark wrote:

Error in formula corrected.

ColA ColB
1A =if(right(A1,1)="A",A1,"")
2C =if(right(A2,1)="A",A1,"")
3D =if(right(A3,1)="A",A1,"")
4E =if(right(A4,1)="A",A1,"")
5W =if(right(A5,1)="A",A1,"")
=countA(b1:b5)


"Mark" wrote:

I have a column where I'm using IF statements to return a value from another
column if certain conditions are meet and "" otherwise. Previously I had
manually enter that information and then did a count of any cell in that
column, using COUNTA, that contain a value. But, since changing to an if
statement, COUNTA is counting every cell because every cell now has an if
statement in it. I want to count cells only when the if statement returns a
value other than "" (blank).

How do I do this?

Here's my data
ColA ColB
1A =if(right(A1,1)="A",A1,"")
2C =if(right(A1,1)="A",A1,"")
3D =if(right(A1,1)="A",A1,"")
4E =if(right(A1,1)="A",A1,"")
5W =if(right(A1,1)="A",A1,"")
=countA(b1:b5)



--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 989
Default Counting

The problem is I used a very simple example. In reality I'm counted hundreds
of things, none of which are the same. It may be 1A, 4U, or "Fred", in that
column and I need to count how many values are returned based on my if
statement.

"Dave Peterson" wrote:

=counta() will count cells with formulas--even those that evaluate to "".

One more if you're trying to count the number of values in A1:A5 that end with
A.

=countif(a1:a5,"*a")

Mark wrote:

Error in formula corrected.

ColA ColB
1A =if(right(A1,1)="A",A1,"")
2C =if(right(A2,1)="A",A1,"")
3D =if(right(A3,1)="A",A1,"")
4E =if(right(A4,1)="A",A1,"")
5W =if(right(A5,1)="A",A1,"")
=countA(b1:b5)


"Mark" wrote:

I have a column where I'm using IF statements to return a value from another
column if certain conditions are meet and "" otherwise. Previously I had
manually enter that information and then did a count of any cell in that
column, using COUNTA, that contain a value. But, since changing to an if
statement, COUNTA is counting every cell because every cell now has an if
statement in it. I want to count cells only when the if statement returns a
value other than "" (blank).

How do I do this?

Here's my data
ColA ColB
1A =if(right(A1,1)="A",A1,"")
2C =if(right(A1,1)="A",A1,"")
3D =if(right(A1,1)="A",A1,"")
4E =if(right(A1,1)="A",A1,"")
5W =if(right(A1,1)="A",A1,"")
=countA(b1:b5)



--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting Mel Excel Discussion (Misc queries) 1 September 29th 06 02:14 PM
Counting Voodoodan Excel Discussion (Misc queries) 11 March 23rd 06 09:34 PM
counting chiapas77 Excel Discussion (Misc queries) 1 March 3rd 06 10:19 PM
Counting rows, then counting values. Michael via OfficeKB.com Excel Discussion (Misc queries) 7 August 4th 05 10:57 PM
Counting names in a column but counting duplicate names once TBoe Excel Discussion (Misc queries) 9 May 11th 05 11:24 PM


All times are GMT +1. The time now is 12:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"