ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   handling calculated excel cell error messages (https://www.excelbanter.com/excel-discussion-misc-queries/162984-handling-calculated-excel-cell-error-messages.html)

Rk

handling calculated excel cell error messages
 
When I try finding a text string within another test string (for exmaple
using "find" or "Search") it returns a value when the text string is found.
However, when the text string is not found it returns an Error ("#Value!").
I'd like to autmatically calulate the cell as "Y" if the text string was
found or "N" if it was not found.

joel

handling calculated excel cell error messages
 
Use instr inplace of find or before search

if instr(string1,",") 0 then
'put find or search here
end if

"RK" wrote:

When I try finding a text string within another test string (for exmaple
using "find" or "Search") it returns a value when the text string is found.
However, when the text string is not found it returns an Error ("#Value!").
I'd like to autmatically calulate the cell as "Y" if the text string was
found or "N" if it was not found.


Dave Peterson

handling calculated excel cell error messages
 
=if(iserror(search(...)),"N","Y")
or:
=if(isnumber(search(...)),"Y","N")


RK wrote:

When I try finding a text string within another test string (for exmaple
using "find" or "Search") it returns a value when the text string is found.
However, when the text string is not found it returns an Error ("#Value!").
I'd like to autmatically calulate the cell as "Y" if the text string was
found or "N" if it was not found.


--

Dave Peterson


All times are GMT +1. The time now is 08:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com