Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default COUNTIF or COUNTIF

Hello All

I am trying to write a function so that if A or N appear in a row, the
number of occurances will be counted and logged. If the result = 0
then that row will be deleted. If have it working with a COUNTIF for
one variable, and I understand that nesting more than one does not
work. Despite searching, I have only found solutions for satisfying
two variables at once (ie. AND), however I need a function to count
whether an A OR an N OR both occur. (It is not the end of the world if
when both an A and an N are found the results are not summed to give
the total number of occurances...as long as the result retunred is <0
it would satisfy the need).

Any advice would be greatly appreciated

Andy
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default COUNTIF or COUNTIF

I'm not sure from your description if A or N can appear together in
the same cell, but you could try this approach:

=COUNTIF(2:2,"A") + COUNTIF(2:2,"N")

which will be 0 if either A or N (alone) appears in row 2. If A or N
could be in the same cell, then you could include wildcards inthe
COUNTIF terms.

Hope this helps.

Pete

On May 14, 4:14*pm, wrote:
Hello All

I am trying to write a function so that if A or N appear in a row, the
number of occurances will be counted and logged. If the result = 0
then that row will be deleted. If have it working with a COUNTIF for
one variable, and I understand that nesting more than one does not
work. Despite searching, I have only found solutions for satisfying
two variables at once (ie. AND), however I need a function to count
whether an A OR an N OR both occur. (It is not the end of the world if
when both an A and an N are found the results are not summed to give
the total number of occurances...as long as the result retunred is <0
it would satisfy the need).

Any advice would be greatly appreciated

Andy


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default COUNTIF or COUNTIF

=SUM(COUNTIF(2:2,{"A","N"}))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
...
Hello All

I am trying to write a function so that if A or N appear in a row, the
number of occurances will be counted and logged. If the result = 0
then that row will be deleted. If have it working with a COUNTIF for
one variable, and I understand that nesting more than one does not
work. Despite searching, I have only found solutions for satisfying
two variables at once (ie. AND), however I need a function to count
whether an A OR an N OR both occur. (It is not the end of the world if
when both an A and an N are found the results are not summed to give
the total number of occurances...as long as the result retunred is <0
it would satisfy the need).

Any advice would be greatly appreciated

Andy



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default COUNTIF or COUNTIF

Many thanks Bob and Pete. Sheet is working a charm now!

Andy
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default COUNTIF or COUNTIF

Thanks for feeding back.

Pete

On May 15, 8:27*am, wrote:
Many thanks Bob and Pete. Sheet is working a charm now!

Andy


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
Countif? Helen Excel Worksheet Functions 1 March 7th 07 09:33 PM
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") sctroy Excel Discussion (Misc queries) 2 September 25th 05 04:13 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM


All times are GMT +1. The time now is 10:22 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"