Question on IF, IFERROR, IFNA formula

rjhemphill

New Member
Joined
Oct 5, 2016
Messages
2
I am having trouble getting my IF, IFERROR,IFNA statements to not populate #N/A or #Value


Here is my current Formula
=IF(B2="Employee",ABS(F2-M2),IF(B2<>"Employee",ABS(N2-M2)))

the issue i am having is that some of the M and N columns don't have dates. so i am getting #Value populated


FMNEmployee Time
10/5/2016
#VALUE!

<tbody>
</tbody>
10/5/20162016-09-27
2016-10-03

<tbody>
</tbody>
8

<tbody>
</tbody>
10/5/20162015-10-13
2016-08-26

<tbody>
</tbody>
358

<tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
So what do you want to display if either M or N is blank

you can do,

=IF(OR(M2="",N2=""),"",IF(B2="Employee",ABS(F2-M2),IF(B2<>"Employee",ABS(N2-M2))))

That way, it returns a blank if either off M2 or N2 is blank

N:B didn't even check for redundancy in the formula, just added another IF to an already existing unneeded IF :) :)
 
Last edited:
Upvote 0
Your 2nd IF is unnecessary because if B2 wasn't Employee in the first check, it would then not be equal to it.

You shouldn't get #VALUE unless your blank cells aren't actually blank, perhaps they contain a space or empty string ""

=IFERROR(ABS(IF(B2="Employee",F2-M2,N2-M2)),"")
 
Upvote 0
You could also just do

Code:
[COLOR=#333333]Iferror(IF(B2="Employee",ABS(F2-M2),IF(B2<>"Employee",ABS(N2-M2))),"")

or for a more in-depth explanation

Iferror([/COLOR][COLOR=#333333]IF(B2="Employee",ABS(F2-M2),IF(B2<>"Employee",ABS(N2-M2))),if(and(M2="",N2=""),"No Dates",if(M2="","No Begin Date","No End Date")))[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,690
Members
449,117
Latest member
Aaagu

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