Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ken Ken is offline
external usenet poster
 
Posts: 6
Default Find function returns the #VALUE! error value

Hi, Using Excel 2003 with no VBA.

I am using the Find function in a cell to search for a comma. When it finds
the comma no problem but the function returns the #VALUE if it does not find
the comma. How do I trap for the error?

I am looking at a cell A1 for names and putting the answer in B1. If the
name is "last, first" I switch them to "first last" with a space. If A1
contains "first last" with no comma I am leaving them alone. Cell Function
is:

=IF(FIND(",",A1,1),A1,RIGHT(A1,LEN(A1)-SEARCH(",",A1,1))&" "&
LEFT(A1,SEARCH(",",A1,1)-1))

Works with comma but returns #VALUE! with no comma.

How to trap for error?

Ken



  #2   Report Post  
Posted to microsoft.public.excel.misc
Ken Ken is offline
external usenet poster
 
Posts: 6
Default Find function returns the #VALUE! error value

I found it.

=IF(ISERROR(FIND(",",A1,1)),A1,RIGHT(A1,LEN(A1)-SEARCH(",",A1,1))&" "&
LEFT(A1,SEARCH(",",A1,1)-1))

Ken

"Ken" wrote in message
...
Hi, Using Excel 2003 with no VBA.

I am using the Find function in a cell to search for a comma. When it
finds the comma no problem but the function returns the #VALUE if it does
not find the comma. How do I trap for the error?

I am looking at a cell A1 for names and putting the answer in B1. If the
name is "last, first" I switch them to "first last" with a space. If A1
contains "first last" with no comma I am leaving them alone. Cell
Function is:

=IF(FIND(",",A1,1),A1,RIGHT(A1,LEN(A1)-SEARCH(",",A1,1))&" "&
LEFT(A1,SEARCH(",",A1,1)-1))

Works with comma but returns #VALUE! with no comma.

How to trap for error?

Ken





  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Find function returns the #VALUE! error value

On Sat, 28 Oct 2006 18:20:18 -0700, "Ken" wrote:

Hi, Using Excel 2003 with no VBA.

I am using the Find function in a cell to search for a comma. When it finds
the comma no problem but the function returns the #VALUE if it does not find
the comma. How do I trap for the error?

I am looking at a cell A1 for names and putting the answer in B1. If the
name is "last, first" I switch them to "first last" with a space. If A1
contains "first last" with no comma I am leaving them alone. Cell Function
is:

=IF(FIND(",",A1,1),A1,RIGHT(A1,LEN(A1)-SEARCH(",",A1,1))&" "&
LEFT(A1,SEARCH(",",A1,1)-1))

Works with comma but returns #VALUE! with no comma.

How to trap for error?

Ken



Try this:

=IF(COUNTIF(A1,"*,*"),MID(A1,FIND(", ",A1)+2,255)
&" "&LEFT(A1,FIND(",",A1)-1),A1)


--ron
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
Networkdays function doesn't find true difference between two dat sesler2 Excel Worksheet Functions 5 October 5th 06 02:32 PM
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
Improve Excel Help Text - Make easier to Find Function Refs RichardAllen Excel Worksheet Functions 0 April 10th 06 05:52 AM
Function that Returns address of that cell? RayWolfDog Excel Worksheet Functions 2 February 15th 06 04:54 PM
UDF and Calculation tree Ken Wright Links and Linking in Excel 1 February 6th 05 04:58 PM


All times are GMT +1. The time now is 04:12 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"