How do I hide #VALUE! error text

  • Thread starter Thread starter NickTheBatMan
  • Start date Start date
N

NickTheBatMan

I've tried as per the help to use conditional formatting and that
doesn't hide the text.

I've tried adding =IFERROR to my formula and it tells me there's an
error in the formula where I've added ,"",

My formulas are =INT(MID($B5,1,(SEARCH("M",$B5,1))-1))
and
=(MID($B5,(SEARCH("M",$B5,1))+1,(SEARCH("C",$B5,1))-1*((SEARCH("M",
$B5,1))+1)))

I'd rather not use script thanks.
 
You need to get at the source of the error. If the cell does not
contain "M" then SEARCH will return an error, so this can be trapped.
Your first formula would become:

=IF(ISERROR(SEARCH("M",$B5)),0,INT(MID($B5,1,(SEARCH("M",$B5))-1)))

although you could use LEFT instead of MID in this case. Also, you
might want to return "" instead of the 0 in the middle.

Hope this helps.

Pete
 
Back
Top