Pass or Fail problem

Gaz_Royal

New Member
Joined
Mar 10, 2002
Messages
7
Ok firstly thanks for reading this post I really do need some help :)

I have a row of 5 codes for individual marks - P for Pass and F for Fail. In the last column I have the overall result - P if all individual results were P and F if any of the 5 results were an F.

My problem is that if no data has been entered the final result defaults to an F for Fail when in fact I would like it to show blank or space.

I think this problem is something to do with NULL value but I'm not sure what to do to resolve this. Any help or guidance will be greatly appreciated. Cheers.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Please could you provid some additional information.

The formula you currently have.
The values that it's looking at.
Any expected results.
 
Upvote 0
Ok here goes Ian

current formula
---------------

=IF(H2="P",IF(I2="P",IF(J2="P",IF(K2="P",IF(L2="P",IF(M2="P",IF(N2="P",IF(O2="P","P","F"),"F"),"F"),"F"),"F"),"F"),"F"),"F")


values that its looking at
--------------------------

9 cells, 8 containing either P for Pass, F for fail and a third data type being Null i think. The final cell is an end result cell (see below)

Expected results
----------------

If all 8 cells contain P then the end result should be P. If any cell contains F then the end result should be F. My problem is that if no data has been entered in any cell the end result defaults to F when I would like it to default to " " (space)


Cheers
 
Upvote 0
On 2002-03-11 06:02, Gaz_Royal wrote:
Ok here goes Ian

current formula
---------------

=IF(H2="P",IF(I2="P",IF(J2="P",IF(K2="P",IF(L2="P",IF(M2="P",IF(N2="P",IF(O2="P","P","F"),"F"),"F"),"F"),"F"),"F"),"F"),"F")


values that its looking at
--------------------------

9 cells, 8 containing either P for Pass, F for fail and a third data type being Null i think. The final cell is an end result cell (see below)

Expected results
----------------

If all 8 cells contain P then the end result should be P. If any cell contains F then the end result should be F. My problem is that if no data has been entered in any cell the end result defaults to F when I would like it to default to " " (space)


Cheers

Try this control-shift-enter formula:

=IF(OR(H2:O2="",H2:O2=" ")," ",IF(AND(H2:O2="P"),"P","F"))

It should do what you want.
 
Upvote 0
I couldn't resist trying:

=IF(COUNTA(H2:O2)<1,"",CHOOSE(COUNTIF(H2:O2,"P"),"F","F","F","F","F","F","F","P"))
 
Upvote 0
Tim:

=IF(OR(H5:O5=" ",H5:O5=" ")," ",IF(AND(H5:O5="P"),"P","F"))

couldn't get this to work at first but then realised I'd forgotten to hit CNTRL+SHIFT+ENTER. This put a {} swirly bracket around the formula and bingo worked great. Not sure what the swirly thing does but its great :)

Ian:

=IF(COUNTA(H2:O2)<8," ",IF(COUNTIF(H2:O2,"P")<8,"F","P"))

This worked fine for F's and P's but didnt like my NULL cells - still defaulted to F until I physically deleted the contents of one of the 8 cells.


Dave:

=IF(COUNTA(H2:O2)<1," ",CHOOSE(COUNTIF(H2:O2,"P"),"F","F","F","F","F","F","F","P"))
Again this worked fine for F's and P's but returned "value" error for cells containing my NULL values until I deleted ALL cell contents.


Once again guys, thanks for the response - fantastic help and my problem has been sorted. Cheers.
 
Upvote 0
There's a way to do this without the array formula. It's longer but faster if you have
a large spreadsheet. (You also don't have to remember a special entry method if you
edit it.)

=IF(COUNTIF(H5:P5,"P")+COUNTIF(H5:P5,"F")<8,"",IF(COUNTIF(H5:P5,"P")=8,"P","F"))
 
Upvote 0
On 2002-03-11 07:38, Gaz_Royal wrote:
Tim:

=IF(OR(H5:O5=" ",H5:O5=" ")," ",IF(AND(H5:O5="P"),"P","F"))

couldn't get this to work at first but then realised I'd forgotten to hit CNTRL+SHIFT+ENTER. This put a {} swirly bracket around the formula and bingo worked great. Not sure what the swirly thing does but its great :)

Ian:

=IF(COUNTA(H2:O2)<8," ",IF(COUNTIF(H2:O2,"P")<8,"F","P"))

This worked fine for F's and P's but didnt like my NULL cells - still defaulted to F until I physically deleted the contents of one of the 8 cells.


Dave:

=IF(COUNTA(H2:O2)<1," ",CHOOSE(COUNTIF(H2:O2,"P"),"F","F","F","F","F","F","F","P"))
Again this worked fine for F's and P's but returned "value" error for cells containing my NULL values until I deleted ALL cell contents.


Once again guys, thanks for the response - fantastic help and my problem has been sorted. Cheers.

My formula should work fine for NULL values as should Dave's, I can only think you have the " "'s in the cells you wanted in the first place. OR are the results coming from an IF statement or LOOKUP where your return is " ", if so change to "" without the space.
 
Upvote 0

Forum statistics

Threads
1,214,402
Messages
6,119,301
Members
448,885
Latest member
LokiSonic

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top