#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Formula Help

My range is B4:U4. Cells may contain the letter "P", the letter "F", the
letters "NR" or they are blank.

I want to return a "1" if there is a "P", the number "0" if there is a "F"
or an "NR" and then the total number of "P" and the total number of "F " and
"NR"

Thanks!

--
V_Ernst
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Formula Help

For a single item, say, B4:

=LOOKUP(B4,{"F","NR","P",""},{1,0,0,""})


to count the "P"

=COUNTIF(B4:U4,"F")

to count the "F" and "NR"

=COUNTIF(B4:U4,"F")+COUNTIF(B4:U4,"NR")
--
Gary''s Student - gsnu200811


"V_Ernst" wrote:

My range is B4:U4. Cells may contain the letter "P", the letter "F", the
letters "NR" or they are blank.

I want to return a "1" if there is a "P", the number "0" if there is a "F"
or an "NR" and then the total number of "P" and the total number of "F " and
"NR"

Thanks!

--
V_Ernst

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default Formula Help

Hi,

In B5, enter the following formula:

=If(B4="P",1,0) and copy this till U5. To get the total of P's use
=countif(B4:U4,"P"). To get the total of "F" and "NR", use
=countif(B4:U4,"F")+=countif(B4:U4,"NR")

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"V_Ernst" wrote in message
...
My range is B4:U4. Cells may contain the letter "P", the letter "F", the
letters "NR" or they are blank.

I want to return a "1" if there is a "P", the number "0" if there is a "F"
or an "NR" and then the total number of "P" and the total number of "F "
and
"NR"

Thanks!

--
V_Ernst


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



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

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"