# Excel - IF Function Problem - Expert Solution

Question description:
This user has given permission to use the problem statement for this blog.

My IF function isn't returning results for me. =IF(A2="","NO",IF(O2="MISSIONARY","YES",IF(O2="NEGOTIATED","YES","NO")))
Solved by O. H. in 20 mins
This is the chat thread from the real Excelchat help session. It contains no private user information.
Excelchat Expert 21/05/2018 - 12:16
Hello, I understand that you need help figuring out what's causing your IF() formula to not return the right results, right?
User 21/05/2018 - 12:16
MOre than 40
User 21/05/2018 - 12:16
Yes correct
Excelchat Expert 21/05/2018 - 12:16
Excelchat Expert 21/05/2018 - 12:17
Before we proceed, this is a reminder that our policy is 1 question per session so for this session we'll be resolving this particular question.
Excelchat Expert 21/05/2018 - 12:17
Are you able to share your file so I can pinpoint where the problem is?
Excelchat Expert 21/05/2018 - 12:17
I need the file because just testing your formula gives me the expected result.
Excelchat Expert 21/05/2018 - 12:18
You can see that your formula in B2 results to NO which is the expected result given the circumstances. Unless there is an error in the logic, of course.
User 21/05/2018 - 12:19
It's okay I will have to figure it out, I thought you might be able to see a flaw in the formula I can't see.
Excelchat Expert 21/05/2018 - 12:20
There's nothing wrong with the formula.
Excelchat Expert 21/05/2018 - 12:20
Excelchat Expert 21/05/2018 - 12:20
Excelchat Expert 21/05/2018 - 12:20
You don't have to send a file if you don't want to, we can just try a dummy data using the document preview to the right.
Excelchat Expert 21/05/2018 - 12:20
Would that be okay?
User 21/05/2018 - 12:21
Yes, that's fine. Not planning to send the file.
Excelchat Expert 21/05/2018 - 12:21
First thing I noticed is that you used A2 and O2 as your cell references, is that intentional?
Excelchat Expert 21/05/2018 - 12:21
Your formula basically means that you are checking if column A is blank first before it does anything else.
Excelchat Expert 21/05/2018 - 12:21
If it's blank then it returns a NO.
User 21/05/2018 - 12:22
So I'm confused why it is checking A2, as A2 is always populated with a repeated name 'UPC'
Excelchat Expert 21/05/2018 - 12:22
Well that depends on what the formula is trying to achieve really.
Excelchat Expert 21/05/2018 - 12:22
Can you tell me what is the purpose of the formula?
Excelchat Expert 21/05/2018 - 12:23
I can rewrite the formula for you if you'll only give me a description of what the formula should be doing.
User 21/05/2018 - 12:23
The formula is returning yes when the airfare is missionary or negotiated, No, when it holds another value.
Excelchat Expert 21/05/2018 - 12:24
Is that what you expect or is that what is happening right now?
Excelchat Expert 21/05/2018 - 12:24
I mean, should the formula return a Yes when the airfare is missionary or negotiated and No when it returns another value?
Excelchat Expert 21/05/2018 - 12:25
Because if that's what you need you can use this formula:
Excelchat Expert 21/05/2018 - 12:25
=if(or(O2="Missionary",O2="Negotiated"),"YES","NO")
User 21/05/2018 - 12:25
It is returning a yes for 180 values, but there are 1893 fields it should be returning...
Excelchat Expert 21/05/2018 - 12:26
The formula I gave you will return a YES if O2 is either a Missionary or Negotiated. It returns a NO if it's neither.
Excelchat Expert 21/05/2018 - 12:28
Are you still with me?
Excelchat Expert 21/05/2018 - 12:29
Our session is about to expire and I won't be able to assist you without a line of communication.
User 21/05/2018 - 12:30
Hm. Thank you.
Excelchat Expert 21/05/2018 - 12:30
I can only provide a solution based on what you told me so far and so far based on the information you've provided this formula should be enough: =if(or(O2="Missionary",O2="Negotiated"),"YES","NO")
Excelchat Expert 21/05/2018 - 12:30
You can test that it works by checking the document preview to the right.
Excelchat Expert 21/05/2018 - 12:31
You can change the value of the red cell to either Missionary or Negotiated and it will return YES, but if it's not either of those, it will return NO.
Excelchat Expert 21/05/2018 - 12:33
Our session will expire in 3 minutes. I would love to offer a more complete solution but since are no longer replying, I'm assuming that you no longer need our help. Hopefully, we were able to provide the solution you seeked.
Excelchat Expert 21/05/2018 - 12:33
Alright, if you have no other questions regarding the original concern, I'd appreciate a 5-star rating and your feedback if you think I deserve it.
Excelchat Expert 21/05/2018 - 12:33
I'll be giving you high ratings as well so the other experts will know that you are a good client and should be taken care of.
Excelchat Expert 21/05/2018 - 12:33
Thank you for contacting Got It Pro. Have an awesome day!

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.

Get instant expert help with Excel and Google Sheets

#### Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Your privacy is guaranteed. Your session will not be used for blog unless you give us persmission.