Limitation in IsError function.

Zeema

New Member
Joined
Jan 29, 2024
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Why does the following formula only works for cell lengths below 7?
=IF(ISERROR(LEFT(A2, FIND("-",A2)-1)),A2)

I am trying to pull portion of the product name to look for SDSs. The formula worked fine till the "Product ID" became longer than 7.

Example: SDS Name =IF(ISERROR(LEFT(D3, FIND("-",D3)-1)),D3)

LengthSDS NameProduct ConstituentProduct ID
6SHS12513%SHS125
10FALSE55%LOC218-275
4PA7575%PA75
4KH45100%KH45
 
Please try this,
Book1
ABCDE
1LengthSDS NameProduct ConstituentProduct IDSDS Name
26SHS12513%SHS125SHS125
310FALSE55%LOC218-275LOC218
44PA7575%PA75PA75
54KH45100%KH45KH45
Sheet1
Cell Formulas
RangeFormula
E2:E5E2=IFERROR(LEFT(D2, FIND("-", D2)-1), D2)
 
Upvote 0
The posts above are the way to go, but just for your info you are getting the FALSE because you haven't put in the formula what you want to happen if there isn't an error

Book1xxxx.xlsb
ABCD
1LengthSDS NameProduct ConstituentProduct ID
26SHS12513%SHS125
310LOC21855%LOC218-275
44PA7575%PA75
54KH45100%KH45
Sheet11
Cell Formulas
RangeFormula
B2:B5B2=IF(ISERROR(LEFT(D2, FIND("-",D2)-1)),D2,LEFT(D2, FIND("-",D2)-1))


or more sensibly....

Book1xxxx.xlsb
ABCD
1LengthSDS NameProduct ConstituentProduct ID
26SHS12513%SHS125
310LOC21855%LOC218-275
44PA7575%PA75
54KH45100%KH45
Sheet11
Cell Formulas
RangeFormula
B2:B5B2=IF(ISERROR(FIND("-",D2)),D2,LEFT(D2, FIND("-",D2)-1))


Edit: just bolded the relevant part of the formula
 
Last edited:
Upvote 0

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