If statement question

Copper Contributor

Can I use a logical function as "the value if true" part of an if statement?  If so, what is the proper syntax to use?

 

I have data that has returned #n/a in its column - here is the formula: =IF((OR(M4<25,M4="#N/A")),0,-3)

 

I need M4, if its value is #N/A, to equal zero.  M4 having a value of #N/A is from a VLOOKUP where some number's in the table array, are not in my "lookup value" sheet, so hence the #n/a value.

 

I want the #N/A results from the vlookup to show as zero in the formula listed above; I thought i may be able to use IFOR, but that seems not to work....

 

4 Replies

@sharrisbyc 

The answer is most probably yes, but if you provide more detailed information we'll be able to help you better.

Yeah after initial post, i figured that would be the case.. I've updated as much as I can. I'm unable to upload sheet due to work policy.

@sharrisbyc 

You write "I need M4, if its value is #N/A, to equal zero."

You can do that by changing the formula in M4. It now looks like

=VLOOKUP(...)

Change it to

=IFERROR(VLOOKUP(...),0)

This can be filled down if required.

 

You may write the formula as below.
=If(
Or(Vlookup(...)<25,Iserror(Vlookup(...))),
0,3)