If there's not an ampersand, I want cell to be empty - it gives me #VALUE! instead

johnmerlino

Board Regular
Joined
Sep 21, 2010
Messages
94
Hey all,

This is pretty much complete. The only issue I'm having is that if there's not ampersand, then just make the cell empty. Rather, it gives me VALUE error:
Code:
=LEFT(A1,IF(ISERROR(FIND("&",A1,1)),"",FIND("&",A1,1)-1))

It doesn't like "" for some reason. Any other way to make the cell empty?

For example, this is what column A1 may have:
AVERNA,ROBERT C

Because no ampersand, it should just return empty space in whatever column the calculation is performed in.

Thanks for response.
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
This should work hopefully,

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

Jesse
 
Upvote 0
Perhaps

=IF(ISERROR(FIND("&",A1)), "", LEFT(A1, FIND("&", A1) - 1))
 
Upvote 0
Hi,

Try this

=IF(ISERROR(LEFT(A1,FIND("&",A1,1))),"",LEFT(A1,FIND("&",A1,1)))
 
Upvote 0

Forum statistics

Threads
1,216,045
Messages
6,128,484
Members
449,455
Latest member
jesski

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