IF statement with FIND not behaving as expected

Zembu

New Member
Joined
Apr 9, 2016
Messages
27
Office Version
  1. 2016
Platform
  1. Windows
Hello Friends

In this;

=IF(FIND("(",B2),(LEFT((B2),LEN(B2)-LEN(B2)+FIND("(",B2)-2)),B2)

I am trying to have it return (if there is no "(" in the cell B2), the contents of cell B2, and if there is a "(" it should return the part of the contents of cell B2 before the "(" and also minus a further character (a space).

I works correctly if there is a "(", but if no "(" it just states #VALUE!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you have 365 or 2024 how about
Excel Formula:
=TRIM(TEXTBEFORE(B2,"(",,,1))
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

If you have 365 or 2024 how about
Excel Formula:
=TRIM(TEXTBEFORE(B2,"(",,,1))
Many thanks Fluff - I have updated now as you suggested. Am using the 2016 version of Office on a Windows PC, so I guess yours won't work for me.
The solution by ExcelToDAX worked
 
Upvote 0

Forum statistics

Threads
1,224,259
Messages
6,177,482
Members
452,782
Latest member
ZCapitao

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