Re: Trapping #VALUE! error

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"RhysPieces" <RhysPieces@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C423F75D-F519-41E9-BE98-762BAF54513C@xxxxxxxxxxxxxxxx
The solutions from T. Valko and Peo Sjoblom work equally well. Thanks to
both
for prompt replies.

"T. Valko" wrote:

Here's one way:

=IF(ISERR(FIND("/",A1)),"",--MID(A1,1,FIND("/",A1)-1))

Or:

=IF(ISERR(FIND("/",A1)),"",--LEFT(A1,FIND("/",A1)-1))

--
Biff
Microsoft Excel MVP


"RhysPieces" <RhysPieces@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FFAA8CD0-0C13-4B70-A155-274B83770F1F@xxxxxxxxxxxxxxxx
I am using a MID function to extract numbers from a string:
=--MID(A1,1,FIND("/",A1)-1)
If the string does not contain "/", it results in the #VALUE! error.
What code needs to go in front of the formula to trap this and return
""?

Thank you for your replies.






.



Relevant Pages

  • Re: Increasing date in link
    ... Thanks so much for your time Biff, ... Valko" wrote: ... link formula to return a TEXT string that looks like a formula. ... Microsoft Excel MVP ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Sum.if date is in an interval...
    ... thanks a lot for invaluable help! ... but that is counting a particular string. ... "Bernard Liengme" wrote: ... Microsoft Excel MVP ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Increasing date in link
    ... Microsoft Excel MVP ... Valko" wrote: ... link formula to return a TEXT string that looks like a formula. ... With the range of formulas still selected goto Edit>Replace ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Sum.if date is in an interval...
    ... thanks a lot for invaluable help! ... but that is counting a particular string. ... "Bernard Liengme" wrote: ... Microsoft Excel MVP ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Help Extracting Numbers formula
    ... Microsoft Excel MVP ... The LEFT function returns the specified number of characters of a string ... starting from the leftmost character. ... then in cell A3, I'd like to multiply 3 and 400. ...
    (microsoft.public.excel.misc)