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  

If 0, count various codes in a range on another sheet



 
 
Thread Tools Display Modes
  #1  
Old January 8th, 2010, 06:08 PM posted to microsoft.public.excel.worksheet.functions
Steve
external usenet poster
 
Posts: 2,662
Default If 0, count various codes in a range on another sheet

I have this formula in N37 =SUM(G37:M37)/5
If the above result is 0, I want to count the number of times a specific
code(PQ) is in a specific range on another worksheet, and in cell N38, I'd
like the result to be, if PQ occurs 2 times in that range, 2 PQ. And if not
0, then nothing.


Something like. If N370, countif(data!A1:A7*PQ*,"")
So the result in the sample would be 2 PQ
A
s
s
pq
pq
s
s
s

Thanks

Steve
  #2  
Old January 8th, 2010, 06:13 PM posted to microsoft.public.excel.worksheet.functions
Bob Phillips[_3_]
external usenet poster
 
Posts: 489
Default If 0, count various codes in a range on another sheet

N38: =IF(N370,COUNTIF(data!A1:A7,"*PQ*"),"")

HTH

Bob

"Steve" wrote in message
...
I have this formula in N37 =SUM(G37:M37)/5
If the above result is 0, I want to count the number of times a specific
code(PQ) is in a specific range on another worksheet, and in cell N38, I'd
like the result to be, if PQ occurs 2 times in that range, 2 PQ. And if
not
0, then nothing.


Something like. If N370, countif(data!A1:A7*PQ*,"")
So the result in the sample would be 2 PQ
A
s
s
pq
pq
s
s
s

Thanks

Steve



  #3  
Old January 8th, 2010, 06:23 PM posted to microsoft.public.excel.worksheet.functions
Basil
external usenet poster
 
Posts: 37
Default If 0, count various codes in a range on another sheet

Try this formula in N38:
=IF(AND(N370,COUNTIF(range,"PQ")=2),"2 PQ","")
replace the word range with the actual range on the other sheet you'll be
looking for PQ in. I've assumed PQ will be on its own in the cells where it
exists.

If you wanted to do the whol elot in cell N37:
=IF(AND(SUM(G37:M37)/50,COUNTIF(range,"PQ")=2),"2 PQ","")

Basil

"Steve" wrote:

I have this formula in N37 =SUM(G37:M37)/5
If the above result is 0, I want to count the number of times a specific
code(PQ) is in a specific range on another worksheet, and in cell N38, I'd
like the result to be, if PQ occurs 2 times in that range, 2 PQ. And if not
0, then nothing.


Something like. If N370, countif(data!A1:A7*PQ*,"")
So the result in the sample would be 2 PQ
A
s
s
pq
pq
s
s
s

Thanks

Steve

  #4  
Old January 8th, 2010, 06:36 PM posted to microsoft.public.excel.worksheet.functions
Steve
external usenet poster
 
Posts: 2,662
Default If 0, count various codes in a range on another sheet

I can't get it to work. One thing I see that I may not have been clear on, is
that the formula appears to be using 2 as an absolute. What I meant to
indicate is that the number of times the PQ is in the specific range may be
1,2, 3 any number of times. So I want to count how many times it's in the
range. Such as -
1 PQ, or 2 PQ, or 3 PQ, etc.

Thanks again,

"Basil" wrote:

Try this formula in N38:
=IF(AND(N370,COUNTIF(range,"PQ")=2),"2 PQ","")
replace the word range with the actual range on the other sheet you'll be
looking for PQ in. I've assumed PQ will be on its own in the cells where it
exists.

If you wanted to do the whol elot in cell N37:
=IF(AND(SUM(G37:M37)/50,COUNTIF(range,"PQ")=2),"2 PQ","")

Basil

"Steve" wrote:

I have this formula in N37 =SUM(G37:M37)/5
If the above result is 0, I want to count the number of times a specific
code(PQ) is in a specific range on another worksheet, and in cell N38, I'd
like the result to be, if PQ occurs 2 times in that range, 2 PQ. And if not
0, then nothing.


Something like. If N370, countif(data!A1:A7*PQ*,"")
So the result in the sample would be 2 PQ
A
s
s
pq
pq
s
s
s

Thanks

Steve

  #5  
Old January 8th, 2010, 07:09 PM posted to microsoft.public.excel.worksheet.functions
Basil
external usenet poster
 
Posts: 37
Default If 0, count various codes in a range on another sheet

Try:
=IF(AND(N370,COUNTIF(range,"PQ")0),COUNTIF(range ,"PQ")&"PQ","")

or you can use a variant of what Bob entered with what is above if it still
doesn't work.

B

"Steve" wrote:

I can't get it to work. One thing I see that I may not have been clear on, is
that the formula appears to be using 2 as an absolute. What I meant to
indicate is that the number of times the PQ is in the specific range may be
1,2, 3 any number of times. So I want to count how many times it's in the
range. Such as -
1 PQ, or 2 PQ, or 3 PQ, etc.

Thanks again,

"Basil" wrote:

Try this formula in N38:
=IF(AND(N370,COUNTIF(range,"PQ")=2),"2 PQ","")
replace the word range with the actual range on the other sheet you'll be
looking for PQ in. I've assumed PQ will be on its own in the cells where it
exists.

If you wanted to do the whol elot in cell N37:
=IF(AND(SUM(G37:M37)/50,COUNTIF(range,"PQ")=2),"2 PQ","")

Basil

"Steve" wrote:

I have this formula in N37 =SUM(G37:M37)/5
If the above result is 0, I want to count the number of times a specific
code(PQ) is in a specific range on another worksheet, and in cell N38, I'd
like the result to be, if PQ occurs 2 times in that range, 2 PQ. And if not
0, then nothing.

Something like. If N370, countif(data!A1:A7*PQ*,"")
So the result in the sample would be 2 PQ
A
s
s
pq
pq
s
s
s

Thanks

Steve

  #6  
Old January 8th, 2010, 08:00 PM posted to microsoft.public.excel.worksheet.functions
Steve
external usenet poster
 
Posts: 2,662
Default If 0, count various codes in a range on another sheet

I couldn't get this one to work, so I tried Bobs.

"Basil" wrote:

Try:
=IF(AND(N370,COUNTIF(range,"PQ")0),COUNTIF(range ,"PQ")&"PQ","")

or you can use a variant of what Bob entered with what is above if it still
doesn't work.

B

"Steve" wrote:

I can't get it to work. One thing I see that I may not have been clear on, is
that the formula appears to be using 2 as an absolute. What I meant to
indicate is that the number of times the PQ is in the specific range may be
1,2, 3 any number of times. So I want to count how many times it's in the
range. Such as -
1 PQ, or 2 PQ, or 3 PQ, etc.

Thanks again,

"Basil" wrote:

Try this formula in N38:
=IF(AND(N370,COUNTIF(range,"PQ")=2),"2 PQ","")
replace the word range with the actual range on the other sheet you'll be
looking for PQ in. I've assumed PQ will be on its own in the cells where it
exists.

If you wanted to do the whol elot in cell N37:
=IF(AND(SUM(G37:M37)/50,COUNTIF(range,"PQ")=2),"2 PQ","")

Basil

"Steve" wrote:

I have this formula in N37 =SUM(G37:M37)/5
If the above result is 0, I want to count the number of times a specific
code(PQ) is in a specific range on another worksheet, and in cell N38, I'd
like the result to be, if PQ occurs 2 times in that range, 2 PQ. And if not
0, then nothing.

Something like. If N370, countif(data!A1:A7*PQ*,"")
So the result in the sample would be 2 PQ
A
s
s
pq
pq
s
s
s

Thanks

Steve

  #7  
Old January 8th, 2010, 08:03 PM posted to microsoft.public.excel.worksheet.functions
Steve
external usenet poster
 
Posts: 2,662
Default If 0, count various codes in a range on another sheet

This one worked to give me the # of PQ's. Thanks,

But I tried to add to it &text to get the # of PQ's & the text PQ, but I
couldn't figure it out.

I'd like the result to be 1 PQ

Thanks again,

Steve

"Bob Phillips" wrote:

N38: =IF(N370,COUNTIF(data!A1:A7,"*PQ*"),"")

HTH

Bob

"Steve" wrote in message
...
I have this formula in N37 =SUM(G37:M37)/5
If the above result is 0, I want to count the number of times a specific
code(PQ) is in a specific range on another worksheet, and in cell N38, I'd
like the result to be, if PQ occurs 2 times in that range, 2 PQ. And if
not
0, then nothing.


Something like. If N370, countif(data!A1:A7*PQ*,"")
So the result in the sample would be 2 PQ
A
s
s
pq
pq
s
s
s

Thanks

Steve



.

  #8  
Old January 8th, 2010, 08:21 PM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default If 0, count various codes in a range on another sheet

=IF(N370,COUNTIF(data!A1:A7,"*PQ*"),"") & " PQ"

Or simply custom format to 0 " PQ"


Gord Dibben MS Excel MVP

On Fri, 8 Jan 2010 12:03:01 -0800, Steve
wrote:

This one worked to give me the # of PQ's. Thanks,

But I tried to add to it &text to get the # of PQ's & the text PQ, but I
couldn't figure it out.

I'd like the result to be 1 PQ

Thanks again,

Steve

"Bob Phillips" wrote:

N38: =IF(N370,COUNTIF(data!A1:A7,"*PQ*"),"")

HTH

Bob

"Steve" wrote in message
...
I have this formula in N37 =SUM(G37:M37)/5
If the above result is 0, I want to count the number of times a specific
code(PQ) is in a specific range on another worksheet, and in cell N38, I'd
like the result to be, if PQ occurs 2 times in that range, 2 PQ. And if
not
0, then nothing.

Something like. If N370, countif(data!A1:A7*PQ*,"")
So the result in the sample would be 2 PQ
A
s
s
pq
pq
s
s
s

Thanks

Steve



.


  #9  
Old January 8th, 2010, 09:34 PM posted to microsoft.public.excel.worksheet.functions
Steve
external usenet poster
 
Posts: 2,662
Default If 0, count various codes in a range on another sheet

Pefect,

Thanks,

Steve

"Gord Dibben" wrote:

=IF(N370,COUNTIF(data!A1:A7,"*PQ*"),"") & " PQ"

Or simply custom format to 0 " PQ"


Gord Dibben MS Excel MVP

On Fri, 8 Jan 2010 12:03:01 -0800, Steve
wrote:

This one worked to give me the # of PQ's. Thanks,

But I tried to add to it &text to get the # of PQ's & the text PQ, but I
couldn't figure it out.

I'd like the result to be 1 PQ

Thanks again,

Steve

"Bob Phillips" wrote:

N38: =IF(N370,COUNTIF(data!A1:A7,"*PQ*"),"")

HTH

Bob

"Steve" wrote in message
...
I have this formula in N37 =SUM(G37:M37)/5
If the above result is 0, I want to count the number of times a specific
code(PQ) is in a specific range on another worksheet, and in cell N38, I'd
like the result to be, if PQ occurs 2 times in that range, 2 PQ. And if
not
0, then nothing.

Something like. If N370, countif(data!A1:A7*PQ*,"")
So the result in the sample would be 2 PQ
A
s
s
pq
pq
s
s
s

Thanks

Steve


.


.

 




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 02:59 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.