Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
mkerstei
 
Posts: n/a
Default Need Help with #N/A in equation


I have a set equation that needs to be run on about a thousand different
entries. A simplified version of the equation would be =A+B+C-D. The
only problem is, "B" is only found in some of the entries. So for the
majority of the times the equation is run for the different entries, it
works, but when "B" is nonexistent, the equation returns a #N/A value.
Is there anyway I can keep the set equation but make it work when B
does not exist?


--
mkerstei
------------------------------------------------------------------------
mkerstei's Profile: http://www.excelforum.com/member.php...o&userid=25688
View this thread: http://www.excelforum.com/showthread...hreadid=391362

  #2   Report Post  
Trevor Shuttleworth
 
Posts: n/a
Default

I think we'll need to see the actual equation as the simplified version will
still work with B blank

Regards

Trevor


"mkerstei" wrote in
message ...

I have a set equation that needs to be run on about a thousand different
entries. A simplified version of the equation would be =A+B+C-D. The
only problem is, "B" is only found in some of the entries. So for the
majority of the times the equation is run for the different entries, it
works, but when "B" is nonexistent, the equation returns a #N/A value.
Is there anyway I can keep the set equation but make it work when B
does not exist?


--
mkerstei
------------------------------------------------------------------------
mkerstei's Profile:
http://www.excelforum.com/member.php...o&userid=25688
View this thread: http://www.excelforum.com/showthread...hreadid=391362



  #3   Report Post  
BenjieLop
 
Posts: n/a
Default


mkerstei Wrote:
I have a set equation that needs to be run on about a thousand different
entries. A simplified version of the equation would be =A+B+C-D. The
only problem is, "B" is only found in some of the entries. So for the
majority of the times the equation is run for the different entries, it
works, but when "B" is nonexistent, the equation returns a #N/A value.
Is there anyway I can keep the set equation but make it work when B
does not exist?


Will this work for you?

=if(B="",A+C+D,A+B+C+D)

OR

=if(iserror(A+B+C+D),A+C+D,A+B+C+D)

Regards.


--
BenjieLop


------------------------------------------------------------------------
BenjieLop's Profile: http://www.excelforum.com/member.php...o&userid=11019
View this thread: http://www.excelforum.com/showthread...hreadid=391362

  #4   Report Post  
JE McGimpsey
 
Posts: n/a
Default

If B is really "nonexistent" then you wouldn't get #N/A.

AFAIK, the only way the + operator returns #N/A is if one of the
arguments has a value of #N/A.

So what's really going on?

If you're using a lookup, you can substitute something like:

=IF(ISNA(VLOOKUP(...)),0,VLOOKUP(...))

If you don't want a zero to appear, either custom format it:

Format/Cells/Number/Custom General;General;;@

or, if zero is a valid value, use


=IF(ISNA(VLOOKUP(...)),"",VLOOKUP(...))

and change your summary formula to

=SUM(A1:C1,-D1)

since SUM() ignores text, but the + operator throws a #VALUE! error.



In article ,
mkerstei
wrote:

I have a set equation that needs to be run on about a thousand different
entries. A simplified version of the equation would be =A+B+C-D. The
only problem is, "B" is only found in some of the entries. So for the
majority of the times the equation is run for the different entries, it
works, but when "B" is nonexistent, the equation returns a #N/A value.
Is there anyway I can keep the set equation but make it work when B
does not exist?

  #5   Report Post  
swatsp0p
 
Posts: n/a
Default


Great solutions, Benjie. May I suggest the OP use the ISNA function
instead of ISERROR? ISNA will only ignore the error caused by the
#N/A, where ISERROR will ignore ALL errors, regardless of the cause and
may hide problems elsewhere in the data.

=if(isna(A+B+C+D),A+C+D,A+B+C+D)

I have seen both Ron deBruin and Dave Peterson make this observation.

Cheers!

Bruce


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=391362



  #6   Report Post  
mkerstei
 
Posts: n/a
Default


Thank you both for your input. You have solved my problem and saved me
hours of frustration.


--
mkerstei
------------------------------------------------------------------------
mkerstei's Profile: http://www.excelforum.com/member.php...o&userid=25688
View this thread: http://www.excelforum.com/showthread...hreadid=391362

  #7   Report Post  
swatsp0p
 
Posts: n/a
Default


Benjielop did the work... wtg. Thanks for the feedback, it is always
appreciated.

Cheers!

Bruce


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=391362

  #8   Report Post  
JE McGimpsey
 
Posts: n/a
Default

A bit more efficient:

If the only cell that may contain the #N/A is B, then there's no need to
resolve the references and do the addition when checking:

=IF(ISNA(B),0,B)+A+C-D

If the #N/A could occur in other columns, then the proposed solution
fails.

Note that the OP said that D should be subtracted, not added.

In article ,
swatsp0p wrote:

Great solutions, Benjie. May I suggest the OP use the ISNA function
instead of ISERROR? ISNA will only ignore the error caused by the
#N/A, where ISERROR will ignore ALL errors, regardless of the cause and
may hide problems elsewhere in the data.

=if(isna(A+B+C+D),A+C+D,A+B+C+D)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Averaging/Rounding Equation Problem Hansel Excel Worksheet Functions 3 June 28th 05 08:47 PM
Averaging/Rounding Equation problem Hansel Excel Discussion (Misc queries) 4 June 28th 05 08:45 PM
I have a long equation which I need to repeat 16 times! CC-Khriz Excel Worksheet Functions 1 June 28th 05 05:01 PM
Rounding in Trendline Equation Phil Hageman Charts and Charting in Excel 3 January 15th 05 01:15 AM
Logarithmic Trendline Equation Phil Hageman Charts and Charting in Excel 2 January 13th 05 11:55 AM


All times are GMT +1. The time now is 12:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"