# Solved: Need help with an IF statement

Not open for further replies.

Joined:
Jan 17, 2011
Messages:
3
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%.

Joined:
Nov 28, 2005
Messages:
62,940
First Name:
Chuck
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%?

Joined:
Jan 17, 2011
Messages:
3
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

4. ### gyclone

Joined:
Jan 16, 2011
Messages:
119
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

```

5. ### jimr381

Joined:
Jul 20, 2007
Messages:
4,189
First Name:
Jim
=If(B2<0.80,"Failed","Passed") That formula should fit your needs if B2 is referencing the total points for that user

Joined:
Jan 17, 2011
Messages:
3
Thank you very much for your support, both formulas worked GREAT!

7. ### jimr381

Joined:
Jul 20, 2007
Messages:
4,189
First Name:
Jim
Good to hear. Let us know if you need anything else.

As Seen On