If(and statement - 2 conditions - 3 outcomes

JoeRooney

Board Regular
Joined
Nov 27, 2017
Messages
169
Office Version
  1. 365
Hi,

I have the below formula and can’t figure out why it returnsa #N/a instead of the “Policy Not Found”

The "Policy found" and “” are working fine the only problem iswith the false value coming up as #N/a instead of "Policy Not Found"



Any help is greatly appreciated.

=IF(AND(A2="",B2=""),"",IF((A2=B2),"PolicyFound","Policy Not Found"))


Thanks
Joe

 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Does either A2 or B2 contain #N/A
 
Upvote 0
Hi,

Yes it does, now I have another problem, I have amended the columnthat it is looking at (code below) so I no longer receive N/A

=IFNA(VLOOKUP(A2,TWG_File!A:AD,1,0),"Not found")

Is it working except it is returning not found for the blankfields, so is it possible to return

The value
Not found
“” for blanks?

Any help is greatly appreciated.

 
Upvote 0
Hi,
I am not sure I understand your question, are you asking that if the vlookip doesnt get a match you want the value to be blank or "Not Found"
 
Upvote 0
Hi,

Sorry no so if there is a match I want it to return thevalue

If it doesn’t match I want it to return “Not found”

Or if both cells are blank I want it to return a blank,


Example below, instead of Not found in the 3rd rowI would like it to return a blank

Hope that makes sense.

policy_id
Policy Number
1111111111
1111111111
2222222222
Not found

Not found

<tbody> </tbody>
 
Upvote 0
Hi,

Yes it does, now I have another problem, I have amended the columnthat it is looking at (code below) so I no longer receive N/A

=IFNA(VLOOKUP(A2,TWG_File!A:AD,1,0),"Not found")

Is it working except it is returning not found for the blankfields, so is it possible to return

The value
Not found
“” for blanks?

Any help is greatly appreciated.

Something like this?

=IFNA(IF(ISBLANK(A2), "", VLOOKUP(A2,TWG_File!A:AD,1,0)),"Not found")
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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