Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Excel Errors / January 2004

Tip: Looking for answers? Try searching our database.

Converting a string to value of zero

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin Sprinkel - 14 Jan 2004 17:20 GMT
I am checking the delta between two columns of numbers in
a third column for the purpose of comparing two rounds of
a construction cost estimate.

Occasionally, what was in the scope the first time around
has been removed (because they can't afford it), in which
case I'd like the text string to have the value of zero.  

Two different attempts yield the errors shown below:

Desired Result (Convert any string to zero)

  A      B      C
  DD     SD     Delta
1  2,000  3,000  -1,000
2  3,500  2,500   1,000
3  NIC    2,000  -2,000

Results with C3 = A3 - B3:

  A      B       C
3  NIC    2,000  #VALUE!

Results with C3 = IIF(Type(A3)=1,A3,0):

  A      B       C
3  NIC    2,000  #NAME?

Any suggestions?

Kevin Sprinkel
Becker & Frondorf
wbez - 15 Jan 2004 10:06 GMT
This formula will sort the problem, if the string appears in your first or
second column.

IF(AND(ISNUMBER(A1),ISNUMBER(B1)),A1-B1,IF(ISNUMBER(A1),A1,IF(AND(ISNUMBER(A
1)=FALSE,ISNUMBER(B1)=FALSE),0,0-B1)))

Maybe  you can figure out how to shorten it.

Cheers
wbez

I am checking the delta between two columns of numbers in
a third column for the purpose of comparing two rounds of
a construction cost estimate.

Occasionally, what was in the scope the first time around
has been removed (because they can't afford it), in which
case I'd like the text string to have the value of zero.

Two different attempts yield the errors shown below:

Desired Result (Convert any string to zero)

  A      B      C
  DD     SD     Delta
1  2,000  3,000  -1,000
2  3,500  2,500   1,000
3  NIC    2,000  -2,000

Results with C3 = A3 - B3:

  A      B       C
3  NIC    2,000  #VALUE!

Results with C3 = IIF(Type(A3)=1,A3,0):

  A      B       C
3  NIC    2,000  #NAME?

Any suggestions?

Kevin Sprinkel
Becker & Frondorf
Kevin Sprinkel - 15 Jan 2004 15:58 GMT
>-----Original Message-----
>This formula will sort the problem, if the string appears in your first or
[quoted text clipped - 7 lines]
>Cheers
>wbez

Thanks, WBEZ, that solved the problem.  I shortened the
last nested If to:

IF(ISNUMBER(B1),0-B1,0)

Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.