# Solved: Need help with an IF statement

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Hi,
I've run into some issues that no matter how much I research I cannot come up with a solution

I need to be able to get an IF formula that will allow me to get a "Passed" or "Failed" answer. This is what I'm doing:

While doing a quality assurance, the agents are measure based on different criteria each section gives the agent up to 10 + or - points for a total of 100%. Now if the agents reach 80% or more they have passed the QA check, anything less than 79% is a failed.

My formula only gives me a "Passed", and the default False.

Is there a formula that will give me a Passed if the agent reached 80%or more and a Failed if is less than 79%.

#### cwwozniak

Chuck
Spam Fighter
Hi and welcome to TSG,

It might help us to help you if you told us exactly what software you using.

It might also help us to troubleshoot your formula if we knew what it is.

EDIT: What should happen if the score is exactly equal to 79%?

Thank you cwwozniak
I am using Winxp, with excel 2007
What should happen if the score is exactly equal to 79%? --> it should read "Failed".
thank you

#### gyclone

Code:
``````Sub get_pass_fail()

Dim result As String
Dim score As Double

Dim CompareRange As Variant, cl As Variant

For Each cl In CompareRange

score = CDec(cl.Value) / 10
If score <= 0.79 Then
result = "Fail"
Else: result = "Pass"
End If

' Insert result into the next cell to the right
Next cl
End Sub``````

#### jimr381

Jim
=If(B2<0.80,"Failed","Passed") That formula should fit your needs if B2 is referencing the total points for that user

Thank you very much for your support, both formulas worked GREAT!

#### jimr381

Jim
Good to hear. Let us know if you need anything else.

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

As Seen On