#1   Report Post  
Ryan
 
Posts: n/a
Default Need Formula

Hello, I hope someone can help me. I am working on a spreadsheet in which I
want to average a column of cells with the letter "Y", but not average the
cells (in the same range) with an "NA". I would also like the average total
be displayed as a percentage.

For Example:
A B C
1 Y
2 NA
3 Y
4 Y
5
6 NA
7 Y

In this example I want to average A1:A7, but return a percentage of the
"Y's" and blanks and not include the "NA's." I know the answer will be 80%
in this example, but I don't know how to express that in a formula.

Thanks in advance,
Ryan

  #2   Report Post  
N Harkawat
 
Posts: n/a
Default

=COUNTIF(A1:A7,"Y")/COUNTIF(A1:A7,"<NA")
and format as percentage

"Ryan" wrote in message
...
Hello, I hope someone can help me. I am working on a spreadsheet in which
I
want to average a column of cells with the letter "Y", but not average the
cells (in the same range) with an "NA". I would also like the average
total
be displayed as a percentage.

For Example:
A B C
1 Y
2 NA
3 Y
4 Y
5
6 NA
7 Y

In this example I want to average A1:A7, but return a percentage of the
"Y's" and blanks and not include the "NA's." I know the answer will be
80%
in this example, but I don't know how to express that in a formula.

Thanks in advance,
Ryan



  #3   Report Post  
Duke Carey
 
Posts: n/a
Default

=(rows(A1:A7)-countif(A1:A7,"NA"))/rows(A1:A7)

Assumes you want to exclude ONLY the NAs. But it's not going to be 80% in
your example. 5/7 is NOT 80%

"Ryan" wrote:

Hello, I hope someone can help me. I am working on a spreadsheet in which I
want to average a column of cells with the letter "Y", but not average the
cells (in the same range) with an "NA". I would also like the average total
be displayed as a percentage.

For Example:
A B C
1 Y
2 NA
3 Y
4 Y
5
6 NA
7 Y

In this example I want to average A1:A7, but return a percentage of the
"Y's" and blanks and not include the "NA's." I know the answer will be 80%
in this example, but I don't know how to express that in a formula.

Thanks in advance,
Ryan

  #4   Report Post  
bj
 
Posts: n/a
Default

if you know you want calculations on 7 rows
one method would be
=1-countif(A1:A7,"NA")/7
and format as a percentage

"Ryan" wrote:

Hello, I hope someone can help me. I am working on a spreadsheet in which I
want to average a column of cells with the letter "Y", but not average the
cells (in the same range) with an "NA". I would also like the average total
be displayed as a percentage.

For Example:
A B C
1 Y
2 NA
3 Y
4 Y
5
6 NA
7 Y

In this example I want to average A1:A7, but return a percentage of the
"Y's" and blanks and not include the "NA's." I know the answer will be 80%
in this example, but I don't know how to express that in a formula.

Thanks in advance,
Ryan

  #5   Report Post  
Biff
 
Posts: n/a
Default

Hi!

return a percentage of the "Y's" and blanks


Are the blank cells truely EMPTY or do they contain formulas that return
formula blanks ("") ?

Can you explain how you get 80% as your result?

Counting "Y's" and blanks as a percentage of the range size results in
71.4286%

Biff

"Ryan" wrote in message
...
Hello, I hope someone can help me. I am working on a spreadsheet in which
I
want to average a column of cells with the letter "Y", but not average the
cells (in the same range) with an "NA". I would also like the average
total
be displayed as a percentage.

For Example:
A B C
1 Y
2 NA
3 Y
4 Y
5
6 NA
7 Y

In this example I want to average A1:A7, but return a percentage of the
"Y's" and blanks and not include the "NA's." I know the answer will be
80%
in this example, but I don't know how to express that in a formula.

Thanks in advance,
Ryan





  #6   Report Post  
Ryan
 
Posts: n/a
Default

The blank Cells are empty...no formulas.

In the average computation, I only want to average the "Y's" and the blanks.
The NA's will not be a part of the average. So in my example, I am only
averaging 5 cells, not 7 (because 2 of the cells contain "NA").

Hope that clarifies.

Thanks again.

Ryan

"Biff" wrote:

Hi!

return a percentage of the "Y's" and blanks


Are the blank cells truely EMPTY or do they contain formulas that return
formula blanks ("") ?

Can you explain how you get 80% as your result?

Counting "Y's" and blanks as a percentage of the range size results in
71.4286%

Biff

"Ryan" wrote in message
...
Hello, I hope someone can help me. I am working on a spreadsheet in which
I
want to average a column of cells with the letter "Y", but not average the
cells (in the same range) with an "NA". I would also like the average
total
be displayed as a percentage.

For Example:
A B C
1 Y
2 NA
3 Y
4 Y
5
6 NA
7 Y

In this example I want to average A1:A7, but return a percentage of the
"Y's" and blanks and not include the "NA's." I know the answer will be
80%
in this example, but I don't know how to express that in a formula.

Thanks in advance,
Ryan




  #7   Report Post  
Biff
 
Posts: n/a
Default

I like Duke's formula but here's an alternative:

=(COUNTIF(A1:A7,"Y")+COUNTBLANK(A1:A7))/ROWS(A1:A7)

Format as PERCENTAGE

Biff

"Ryan" wrote in message
...
The blank Cells are empty...no formulas.

In the average computation, I only want to average the "Y's" and the
blanks.
The NA's will not be a part of the average. So in my example, I am only
averaging 5 cells, not 7 (because 2 of the cells contain "NA").

Hope that clarifies.

Thanks again.

Ryan

"Biff" wrote:

Hi!

return a percentage of the "Y's" and blanks


Are the blank cells truely EMPTY or do they contain formulas that return
formula blanks ("") ?

Can you explain how you get 80% as your result?

Counting "Y's" and blanks as a percentage of the range size results in
71.4286%

Biff

"Ryan" wrote in message
...
Hello, I hope someone can help me. I am working on a spreadsheet in
which
I
want to average a column of cells with the letter "Y", but not average
the
cells (in the same range) with an "NA". I would also like the average
total
be displayed as a percentage.

For Example:
A B C
1 Y
2 NA
3 Y
4 Y
5
6 NA
7 Y

In this example I want to average A1:A7, but return a percentage of the
"Y's" and blanks and not include the "NA's." I know the answer will be
80%
in this example, but I don't know how to express that in a formula.

Thanks in advance,
Ryan






  #8   Report Post  
Manish Bajpai
 
Posts: n/a
Default

=COUNTIF($A$1:$A$7,"Y")/(COUNTIF($A$1:$A$7,"")+COUNTIF($A$1:$A$7,"Y"))

Hope, the above formula will work for your problem.

Thanks,

Manish Bajpai

"Ryan" wrote:

The blank Cells are empty...no formulas.

In the average computation, I only want to average the "Y's" and the blanks.
The NA's will not be a part of the average. So in my example, I am only
averaging 5 cells, not 7 (because 2 of the cells contain "NA").

Hope that clarifies.

Thanks again.

Ryan

"Biff" wrote:

Hi!

return a percentage of the "Y's" and blanks


Are the blank cells truely EMPTY or do they contain formulas that return
formula blanks ("") ?

Can you explain how you get 80% as your result?

Counting "Y's" and blanks as a percentage of the range size results in
71.4286%

Biff

"Ryan" wrote in message
...
Hello, I hope someone can help me. I am working on a spreadsheet in which
I
want to average a column of cells with the letter "Y", but not average the
cells (in the same range) with an "NA". I would also like the average
total
be displayed as a percentage.

For Example:
A B C
1 Y
2 NA
3 Y
4 Y
5
6 NA
7 Y

In this example I want to average A1:A7, but return a percentage of the
"Y's" and blanks and not include the "NA's." I know the answer will be
80%
in this example, but I don't know how to express that in a formula.

Thanks in advance,
Ryan




  #9   Report Post  
Ryan
 
Posts: n/a
Default

I got the formula to work. Thank you all so much for your help.

"Manish Bajpai" wrote:

=COUNTIF($A$1:$A$7,"Y")/(COUNTIF($A$1:$A$7,"")+COUNTIF($A$1:$A$7,"Y"))

Hope, the above formula will work for your problem.

Thanks,

Manish Bajpai

"Ryan" wrote:

The blank Cells are empty...no formulas.

In the average computation, I only want to average the "Y's" and the blanks.
The NA's will not be a part of the average. So in my example, I am only
averaging 5 cells, not 7 (because 2 of the cells contain "NA").

Hope that clarifies.

Thanks again.

Ryan

"Biff" wrote:

Hi!

return a percentage of the "Y's" and blanks

Are the blank cells truely EMPTY or do they contain formulas that return
formula blanks ("") ?

Can you explain how you get 80% as your result?

Counting "Y's" and blanks as a percentage of the range size results in
71.4286%

Biff

"Ryan" wrote in message
...
Hello, I hope someone can help me. I am working on a spreadsheet in which
I
want to average a column of cells with the letter "Y", but not average the
cells (in the same range) with an "NA". I would also like the average
total
be displayed as a percentage.

For Example:
A B C
1 Y
2 NA
3 Y
4 Y
5
6 NA
7 Y

In this example I want to average A1:A7, but return a percentage of the
"Y's" and blanks and not include the "NA's." I know the answer will be
80%
in this example, but I don't know how to express that in a formula.

Thanks in advance,
Ryan




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
referencing named formula using INDIRECT function [email protected] Excel Worksheet Functions 19 May 11th 05 09:48 AM
Simplify formula Luke Excel Worksheet Functions 37 May 6th 05 07:21 AM
put formula results into a different cell if it is empty PutFormula Excel Worksheet Functions 2 February 11th 05 03:31 AM
how do i write a formula and keep in in formula form, so it DOESN. norcalchick2207 Excel Discussion (Misc queries) 2 February 4th 05 08:38 PM
Match / Vlookup within an Array formula Hari Prasadh Excel Discussion (Misc queries) 3 February 3rd 05 04:37 PM


All times are GMT +1. The time now is 09:43 PM.

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

About Us

"It's about Microsoft Excel"