#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default #Value! error

How does one "overcome" the #Value! error when used in a function?

Example:

A1= "4 DR. SEDAN"

I want to FIND "DR."

The formula I use is =FIND("DR.",A1,1) and this works fine however when
A1 does not contain "DR." I get the error.

I am actually trying to replace "DR. " with "Door" but the error causes
the formula to fail.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 221
Default #Value! error

First, is there some reason you can't Ctrl+H, and replace
"(space)DR.(space)" with "DOOR"?
Alternatively, what do you want to do if DR. does not exist in the string?
If nothing, then try this:

=(IF(ISERROR(FIND("DR.",A1,1)),"",FIND("DR.",A1,1) )

****************************
Hope it helps!
Anne Troy
www.OfficeArticles.com
****************************
"HalB" wrote in message
...
How does one "overcome" the #Value! error when used in a function?

Example:

A1= "4 DR. SEDAN"

I want to FIND "DR."

The formula I use is =FIND("DR.",A1,1) and this works fine however when A1
does not contain "DR." I get the error.

I am actually trying to replace "DR. " with "Door" but the error causes
the formula to fail.

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default #Value! error

Try this:

=IF(ISERR(FIND("DR.",A1,1)),A1,SUBSTITUTE(A1,"DR." ,"DOOR"))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"HalB" wrote in message
...
How does one "overcome" the #Value! error when used in a function?

Example:

A1= "4 DR. SEDAN"

I want to FIND "DR."

The formula I use is =FIND("DR.",A1,1) and this works fine however when
A1 does not contain "DR." I get the error.

I am actually trying to replace "DR. " with "Door" but the error causes
the formula to fail.

Thanks


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default #Value! error

I am currently doing the Ctrl-H, just trying to automate.

What I want to do is IF DR exists, replace it with Door, otherwise do
nothing.
Trying to nest FIND in either the IF or the REPLACE functions returns
the error.

Thanks



Anne Troy wrote:
First, is there some reason you can't Ctrl+H, and replace
"(space)DR.(space)" with "DOOR"?
Alternatively, what do you want to do if DR. does not exist in the string?
If nothing, then try this:

=(IF(ISERROR(FIND("DR.",A1,1)),"",FIND("DR.",A1,1) )

****************************
Hope it helps!
Anne Troy
www.OfficeArticles.com
****************************
"HalB" wrote in message
...
How does one "overcome" the #Value! error when used in a function?

Example:

A1= "4 DR. SEDAN"

I want to FIND "DR."

The formula I use is =FIND("DR.",A1,1) and this works fine however when A1
does not contain "DR." I get the error.

I am actually trying to replace "DR. " with "Door" but the error causes
the formula to fail.

Thanks



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default #Value! error

Voila!

Thanks!


Ragdyer wrote:
Try this:

=IF(ISERR(FIND("DR.",A1,1)),A1,SUBSTITUTE(A1,"DR." ,"DOOR"))



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default #Value! error

One word of note:

Your original formula, and the one I suggested, which was built around it,
is *case sensitive*!

If the "DR." may be "dr." in some of your data, you would need a more robust
formula.

You might use this instead of my original suggestion, since it would work
for all situations:

=IF(ISERR(SEARCH("DR.",A1)),A1,SUBSTITUTE(UPPER(A1 ),"DR.","DOOR"))

Appreciate the feed-back.

--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"HalB" wrote in message
...
Voila!

Thanks!


Ragdyer wrote:
Try this:

=IF(ISERR(FIND("DR.",A1,1)),A1,SUBSTITUTE(A1,"DR." ,"DOOR"))


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default #Value! error

No need to use FIND() at all - just use

=SUBSTITUTE(A1,"DR.","Door")

If "DR." doesn't exist, no error will be raised.

In article , HalB
wrote:

I am actually trying to replace "DR. " with "Door" but the error causes
the formula to fail.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 221
Default #Value! error

Nice. :)
****************************
Hope it helps!
Anne Troy
www.OfficeArticles.com
****************************
"JE McGimpsey" wrote in message
...
No need to use FIND() at all - just use

=SUBSTITUTE(A1,"DR.","Door")

If "DR." doesn't exist, no error will be raised.

In article , HalB
wrote:

I am actually trying to replace "DR. " with "Door" but the error causes
the formula to fail.



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default #Value! error

Yellow complexion is from all the egg on my face.<vbg

Although still wouldn't hurt to use Upper().
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"JE McGimpsey" wrote in message
...
No need to use FIND() at all - just use

=SUBSTITUTE(A1,"DR.","Door")

If "DR." doesn't exist, no error will be raised.

In article , HalB
wrote:

I am actually trying to replace "DR. " with "Door" but the error causes
the formula to fail.


  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 221
Default #Value! error

Yeah. Right. As if you haven't thrown some egg yourself! You're just one of
the many I admire here, RD; one of the many who teach me new things all the
time. There are just some functions I can't get "on my list". SUBSTITUTE is
one of them. :)

****************************
Hope it helps!
Anne Troy
www.OfficeArticles.com
****************************
"Ragdyer" wrote in message
...
Yellow complexion is from all the egg on my face.<vbg

Although still wouldn't hurt to use Upper().
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"JE McGimpsey" wrote in message
...
No need to use FIND() at all - just use

=SUBSTITUTE(A1,"DR.","Door")

If "DR." doesn't exist, no error will be raised.

In article , HalB
wrote:

I am actually trying to replace "DR. " with "Door" but the error causes
the formula to fail.






  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 698
Default #Value! error

Try something like this:

=SUBSTITUTE(UPPER(A1),"DR.","DOOR")

If A1= "4 DR. SEDAN"
The formula returns: 4 DOOR SEDAN

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"HalB" wrote:

How does one "overcome" the #Value! error when used in a function?

Example:

A1= "4 DR. SEDAN"

I want to FIND "DR."

The formula I use is =FIND("DR.",A1,1) and this works fine however when
A1 does not contain "DR." I get the error.

I am actually trying to replace "DR. " with "Door" but the error causes
the formula to fail.

Thanks

  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default #Value! error

You don't really need
=IF(ISERR(FIND("DR.",A1,1)),A1........

all you need is

SUBSTITUTE(A1,"DR.","DOOR")
It it can not find "DR." it will return A1 anyway


"Ragdyer" wrote:

Try this:

=IF(ISERR(FIND("DR.",A1,1)),A1,SUBSTITUTE(A1,"DR." ,"DOOR"))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"HalB" wrote in message
...
How does one "overcome" the #Value! error when used in a function?

Example:

A1= "4 DR. SEDAN"

I want to FIND "DR."

The formula I use is =FIND("DR.",A1,1) and this works fine however when
A1 does not contain "DR." I get the error.

I am actually trying to replace "DR. " with "Door" but the error causes
the formula to fail.

Thanks



  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 221
Default #Value! error

Hi, Ron! :)
****************************
Hope it helps!
Anne Troy
www.OfficeArticles.com
****************************
"Ron Coderre" wrote in message
...
Try something like this:

=SUBSTITUTE(UPPER(A1),"DR.","DOOR")

If A1= "4 DR. SEDAN"
The formula returns: 4 DOOR SEDAN

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"HalB" wrote:

How does one "overcome" the #Value! error when used in a function?

Example:

A1= "4 DR. SEDAN"

I want to FIND "DR."

The formula I use is =FIND("DR.",A1,1) and this works fine however when
A1 does not contain "DR." I get the error.

I am actually trying to replace "DR. " with "Door" but the error causes
the formula to fail.

Thanks



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
Error: "Excel encountered an error and had to remove some formatti Carl Excel Discussion (Misc queries) 0 September 18th 06 06:39 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
I have Error 1919 Error Configuring ODBC dataSource Database Texanna1 Excel Discussion (Misc queries) 1 September 12th 06 06:35 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 02:48 PM.

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"