**Question description:**

*This user has given permission to use the problem statement for this blog.*

I need help with an IF statement in Excel.
I work for a youth hockey organization and I have the scores of the recent games. A win of more than 5 goals or a loss of more than 5 goals is called a 'blowout' game. How can I write a formula to say if a value in a cell is >5 or <5, return the value of 1 so that I can simply count the number of 'blowout' games? If the answer does not meet criteria return the value of 0.

Solved by B. A. in 20 mins

This is the chat thread from the real Excelchat help session. It contains no private user information.

Excelchat Expert
20/09/2017 - 08:29

Welcome, Thanks for choosing Got It Pro-Excel!

Excelchat Expert
20/09/2017 - 08:29

How may I help you today!

User
20/09/2017 - 08:29

I can write the formula for the >5 and the <5 but I cannot seem to combine into one formula.

Excelchat Expert
20/09/2017 - 08:30

No worries I'll write it for yo

Excelchat Expert
20/09/2017 - 08:30

*you

User
20/09/2017 - 08:30

THANK YOU!

Excelchat Expert
20/09/2017 - 08:30

would you please me give a moment to solve your problem?

User
20/09/2017 - 08:30

sure

Excelchat Expert
20/09/2017 - 08:30

I’ll be back to you soon Thanks.

Excelchat Expert
20/09/2017 - 08:31

You need formula if value is greater than or less than 5 it should return 1?

User
20/09/2017 - 08:31

yes

Excelchat Expert
20/09/2017 - 08:32

OK

User
20/09/2017 - 08:32

otherwise return 0

Excelchat Expert
20/09/2017 - 08:32

Otherwise means ?

User
20/09/2017 - 08:32

if not >5 or <5 return 0 in the formula

Excelchat Expert
20/09/2017 - 08:33

Greater than 5 are all values greater than five & less than means 0-5, than what may be other value?

User
20/09/2017 - 08:34

correct

User
20/09/2017 - 08:34

0,1,2,3,4 and 5 would return 0

Excelchat Expert
20/09/2017 - 08:34

Please explain than?

Excelchat Expert
20/09/2017 - 08:34

OK

User
20/09/2017 - 08:34

a score of 9-2 is a difference of 7

User
20/09/2017 - 08:34

I call that delta of 7 a blowout game because it's >5

User
20/09/2017 - 08:34

a score of 2-1 is not, delta is only 1

Excelchat Expert
20/09/2017 - 08:37

=IF(A1>5,1,IF(A1=5,0,IF(A1<5,0)))

Excelchat Expert
20/09/2017 - 08:37

I think this is you need

Excelchat Expert
20/09/2017 - 08:37

Please verify or clarify?

User
20/09/2017 - 08:37

let me try it on a sample set of scores

User
20/09/2017 - 08:37

one second

Excelchat Expert
20/09/2017 - 08:37

Yes please

User
20/09/2017 - 08:41

a value of -9 did not work properly

User
20/09/2017 - 08:41

came back as 0

Excelchat Expert
20/09/2017 - 08:41

OK

Excelchat Expert
20/09/2017 - 08:41

You need that -9 should give 1?

User
20/09/2017 - 08:41

yes

Excelchat Expert
20/09/2017 - 08:42

Others are good?

User
20/09/2017 - 08:42

I think I fixed the end of the formula

User
20/09/2017 - 08:42

let me see what the number 1 brings back

Excelchat Expert
20/09/2017 - 08:42

Yes please

User
20/09/2017 - 08:43

=IF(A1>5,1,IF(A1=5,0,IF(A1<5,0))) the value of 2 does not come back as 0

Excelchat Expert
20/09/2017 - 08:43

One minute

User
20/09/2017 - 08:43

0.1.2.3.4 and 5 should all come back as 0

Excelchat Expert
20/09/2017 - 08:43

Here its giving 0

Excelchat Expert
20/09/2017 - 08:44

For my sheet its giving 0 for all 0,1,2,3,4,5

Excelchat Expert
20/09/2017 - 08:44

Can you see here on google sheets?

User
20/09/2017 - 08:44

send me the formula one more time please

User
20/09/2017 - 08:44

It might be me

Excelchat Expert
20/09/2017 - 08:45

Have you seen please?

Excelchat Expert
20/09/2017 - 08:45

=IF(A1>5,1,IF(A1=5,0,IF(A1<5,0)))

**This is the output file from the real Excelchat help session:**

*This is an example of the expert help you can get. It contains no private user information.*