ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Formula Help (https://www.excelbanter.com/excel-worksheet-functions/208823-formula-help.html)

V_Ernst

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

Gary''s Student

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


Ashish Mathur[_2_]

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




All times are GMT +1. The time now is 12:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com