Suppress #VALUE! error

sbrotz

Board Regular
Joined
Jul 22, 2004
Messages
138
In the formula below, I am trying to find the word "Mobile:" within a text string contained in cell N5 and if present, add 8 spaces from where it is found, then copy the next 14 characters. If "Mobile:" is not found, the cell should be blank. I know I am close, but not quite there. What am I doing wrong?

=IF(MID(N5,FIND("Mobile:",N5)+8,14)="#VALUE!","",MID(N5,FIND("Mobile:",N5)+8,14))

If N5 is: Residence: (845) 223-XXXX;Business: (845) 473-XXXX#1106,
then the return should be a blank cell.

If N5 is: Residence: (914) 686-XXXX;Business: (914) 592-XXXX;Mobile: (914) 760-XXXX;Business: (201) 986-XXXX #2076;Business: (908) 272-XXXX
then the return should be: (914) 760-XXXX
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
You could also try:

=IF(IsError(N5,FIND("Mobile:",N5)+8,14)="true","",MID(N5,FIND("Mobile:",N5)+8,14))
 
Upvote 0
Indeed, rconverse, that's a more "standard" approach, although as written I don't think your formula will work because you haven't included "MID" in the first part.

In fact, you can probably just check for an error in the FIND function....and you don't need "=TRUE", so that would be

=IF(ISERR(FIND("Mobile:",N5)),"",MID(N5,FIND("Mobile:",N5)+8,14)))
 
Upvote 0

Forum statistics

Threads
1,214,385
Messages
6,119,209
Members
448,874
Latest member
b1step2far

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top