IF(ISERROR...won't return first value which is a cell reference

blini

New Member
Joined
May 30, 2014
Messages
2
Hello,

I have to clean up a dataset of names by removing a middle name if it has been included with the firstname.

So, I'm using the following formula to look for a space, return the cell itself if there is no space, or just the first word if there is a space.

I know the formula is in German, so that is why I have given the English version underneath. (My German isn't good enough to write the question.)

=WENN(NICHT(FINDEN(" ";B3;1));B3;LINKS(B3;FINDEN(" ";B3;1)-1))

= IF(ISERROR(FIND(" ",B3,1)),B3,LEFT(B3,FIND(" ",B3,1)-1))


The formula works if there is a second name in the cell, but returns a #NO VALUE! (#WERT!) error if there is just one name by itself.

How can I get the cell value to be returned when there is just one name present in the cell?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Your formula already does this.

If your cell contains a space it will return all characters up to the space.
If your cell does not contain a space it will return the cell value.

What value does your cell contain that gives you an error?


Excel 2010
AB
1JohnJohn Doe
2JohnJohn
Sheet1
Cell Formulas
RangeFormula
A1= IF(ISERROR(FIND(" ",B1,1)),B1,LEFT(B1,FIND(" ",B1,1)-1))
 
Upvote 0
Ah, I got the wrong German word for ISERROR, it should be ISTFEHLER. The German NICHT equates to NOT.

Thanks for the confirmation that the formula was correct in English.

Problem solved :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,626
Members
449,093
Latest member
catterz66

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