A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

need formula to add two different criteria in a range



 
 
Thread Tools Display Modes
  #1  
Old April 29th, 2010, 03:09 PM posted to microsoft.public.excel.worksheet.functions
Meenie
external usenet poster
 
Posts: 270
Default need formula to add two different criteria in a range

I want to count the number of "yes" in a range and the number of "n/a" in a
range and get that total.
If I enter =sum(if(range,"yes"+"n/a")) I get "#Value"
If I enter =sum(if(range,"yes")+(range,"n/a")) I get "formula contains an
error"
I've tried several variations on this with sum, sumif, count, counta,
countif...
Can someone please give me a clue??
Thanks, Meenie
--
Y****er
  #2  
Old April 29th, 2010, 03:17 PM posted to microsoft.public.excel.worksheet.functions
Bernard Liengme
external usenet poster
 
Posts: 516
Default need formula to add two different criteria in a range

=COUNTIF(A1:A100,"yes")
if n/a was entered as text
=COUNTIF(A1:A100,"n/a")
if n/a was enterd with the NA() function
=SUMPRODUCT(--(ISNA(A1:A100)))

best wishes
--
www.stfx.ca/people/bliengme


"Meenie" wrote:

I want to count the number of "yes" in a range and the number of "n/a" in a
range and get that total.
If I enter =sum(if(range,"yes"+"n/a")) I get "#Value"
If I enter =sum(if(range,"yes")+(range,"n/a")) I get "formula contains an
error"
I've tried several variations on this with sum, sumif, count, counta,
countif...
Can someone please give me a clue??
Thanks, Meenie
--
Y****er

  #3  
Old April 29th, 2010, 03:21 PM posted to microsoft.public.excel.worksheet.functions
Jacob Skaria
external usenet poster
 
Posts: 5,952
Default need formula to add two different criteria in a range

Hi Meenie

Try
=SUM(COUNTIF(A:A,{"Yes","n/a"}))

--
Jacob (MVP - Excel)


"Meenie" wrote:

I want to count the number of "yes" in a range and the number of "n/a" in a
range and get that total.
If I enter =sum(if(range,"yes"+"n/a")) I get "#Value"
If I enter =sum(if(range,"yes")+(range,"n/a")) I get "formula contains an
error"
I've tried several variations on this with sum, sumif, count, counta,
countif...
Can someone please give me a clue??
Thanks, Meenie
--
Y****er

  #4  
Old April 29th, 2010, 03:23 PM posted to microsoft.public.excel.worksheet.functions
Meenie
external usenet poster
 
Posts: 270
Default need formula to add two different criteria in a range

yes and n/a are both entered as text.
I know how to count one or the other, how to I count the total occurence of
both within the range?
--
Y****er


"Bernard Liengme" wrote:

=COUNTIF(A1:A100,"yes")
if n/a was entered as text
=COUNTIF(A1:A100,"n/a")
if n/a was enterd with the NA() function
=SUMPRODUCT(--(ISNA(A1:A100)))

best wishes
--
www.stfx.ca/people/bliengme


"Meenie" wrote:

I want to count the number of "yes" in a range and the number of "n/a" in a
range and get that total.
If I enter =sum(if(range,"yes"+"n/a")) I get "#Value"
If I enter =sum(if(range,"yes")+(range,"n/a")) I get "formula contains an
error"
I've tried several variations on this with sum, sumif, count, counta,
countif...
Can someone please give me a clue??
Thanks, Meenie
--
Y****er

  #5  
Old April 29th, 2010, 03:31 PM posted to microsoft.public.excel.worksheet.functions
Meenie
external usenet poster
 
Posts: 270
Default need formula to add two different criteria in a range

Perfect!! Thanks Jacob
--
Y****er


"Jacob Skaria" wrote:

Hi Meenie

Try
=SUM(COUNTIF(A:A,{"Yes","n/a"}))

--
Jacob (MVP - Excel)


"Meenie" wrote:

I want to count the number of "yes" in a range and the number of "n/a" in a
range and get that total.
If I enter =sum(if(range,"yes"+"n/a")) I get "#Value"
If I enter =sum(if(range,"yes")+(range,"n/a")) I get "formula contains an
error"
I've tried several variations on this with sum, sumif, count, counta,
countif...
Can someone please give me a clue??
Thanks, Meenie
--
Y****er

  #6  
Old April 29th, 2010, 03:55 PM posted to microsoft.public.excel.worksheet.functions
Luke M[_4_]
external usenet poster
 
Posts: 451
Default need formula to add two different criteria in a range

Add the two functions together...
=COUNTIF(A1:A100,"yes")+COUNTIF(A1:A100,"n/a")

--
Best Regards,

Luke M
"Meenie" wrote in message
...
yes and n/a are both entered as text.
I know how to count one or the other, how to I count the total occurence
of
both within the range?
--
Y****er


"Bernard Liengme" wrote:

=COUNTIF(A1:A100,"yes")
if n/a was entered as text
=COUNTIF(A1:A100,"n/a")
if n/a was enterd with the NA() function
=SUMPRODUCT(--(ISNA(A1:A100)))

best wishes
--
www.stfx.ca/people/bliengme


"Meenie" wrote:

I want to count the number of "yes" in a range and the number of "n/a"
in a
range and get that total.
If I enter =sum(if(range,"yes"+"n/a")) I get "#Value"
If I enter =sum(if(range,"yes")+(range,"n/a")) I get "formula contains
an
error"
I've tried several variations on this with sum, sumif, count, counta,
countif...
Can someone please give me a clue??
Thanks, Meenie
--
Y****er



  #7  
Old April 29th, 2010, 11:15 PM posted to microsoft.public.excel.worksheet.functions
Dave Peterson
external usenet poster
 
Posts: 19,791
Default need formula to add two different criteria in a range

This will work for those =na() errors:
=countif(a1:a100,"#n/a")

Bernard Liengme wrote:

=COUNTIF(A1:A100,"yes")
if n/a was entered as text
=COUNTIF(A1:A100,"n/a")
if n/a was enterd with the NA() function
=SUMPRODUCT(--(ISNA(A1:A100)))

best wishes
--
www.stfx.ca/people/bliengme

"Meenie" wrote:

I want to count the number of "yes" in a range and the number of "n/a" in a
range and get that total.
If I enter =sum(if(range,"yes"+"n/a")) I get "#Value"
If I enter =sum(if(range,"yes")+(range,"n/a")) I get "formula contains an
error"
I've tried several variations on this with sum, sumif, count, counta,
countif...
Can someone please give me a clue??
Thanks, Meenie
--
Y****er


--

Dave Peterson
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:20 AM.


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