+ Reply to Thread
Results 1 to 7 of 7

Another Syntax Error

  1. #1
    Registered User
    Join Date
    01-25-2012
    Location
    ...
    MS-Off Ver
    Excel 2007
    Posts
    21

    Another Syntax Error

    When I enter the following formula, I receive the following error:

    "the specified formula cannot be entered because it uses more levels of nesting"

    Please Login or Register  to view this content.
    How can I change this code to make it work?

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Another Syntax Error

    In case of limitation of nesting, try to name sub-formula, i.e:
    TEXT1 = LEFT(J$6,2)&TEXT(LEFT(SUBSTITUTE(SUBSTITUTE(LEFT(J$6,FIND(" ",J$6&" ")-1),LEFT(J$6,2),""),"-",REPT(" ",10)),10),"000")&"-"&TEXT(RIGHT(SUBSTITUTE(SUBSTITUTE(LEFT(J$6,FIND(" ",J$6&" ")-1),LEFT(J$6,2),""),"-",REPT(" ",10)),10),"000")
    Replace with TEXT1:
    =IFERROR(INDEX(.....,MATCH($B$7&TEXT1,...)...)
    Quang PT

  3. #3
    Registered User
    Join Date
    01-25-2012
    Location
    ...
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Another Syntax Error

    Quote Originally Posted by bebo021999 View Post
    In case of limitation of nesting, try to name sub-formula, i.e:
    TEXT1 = LEFT(J$6,2)&TEXT(LEFT(SUBSTITUTE(SUBSTITUTE(LEFT(J$6,FIND(" ",J$6&" ")-1),LEFT(J$6,2),""),"-",REPT(" ",10)),10),"000")&"-"&TEXT(RIGHT(SUBSTITUTE(SUBSTITUTE(LEFT(J$6,FIND(" ",J$6&" ")-1),LEFT(J$6,2),""),"-",REPT(" ",10)),10),"000")
    Replace with TEXT1:
    =IFERROR(INDEX(.....,MATCH($B$7&TEXT1,...)...)
    I am not familiar with sub fromulas in excel. Is the whole code entered in one cell? or do you have to define them in separate cells?

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Another Syntax Error

    I means you could use defined name by press Ctrl-F3, name: TEXT1; Refer to: =LEFT(......), OK
    Then replace your origin formula with TEXT1 name

  5. #5
    Registered User
    Join Date
    01-25-2012
    Location
    ...
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Another Syntax Error

    Quote Originally Posted by bebo021999 View Post
    I means you could use defined name by press Ctrl-F3, name: TEXT1; Refer to: =LEFT(......), OK
    Then replace your origin formula with TEXT1 name
    I am not able to define names because the sheet is protected. Is there a workaround to do this without having to name a formula?

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Another Syntax Error

    Try to use a helper cell :e.g B100=TEXT(LEFT(SUBSTITUTE(SUBSTITUTE(LEFT(J$6,FIND(" ",J$6&" ")-1),LEFT(J$6,2),""),"-",REPT(" ",10)),10),"000")&"-"&TEXT(RIGHT(SUBSTITUTE(SUBSTITUTE(LEFT(J$6,FIND(" ",J$6&" ")-1),LEFT(J$6,2),""),"-",REPT(" ",10)),10),"000")

    Then your formula will be:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-25-2012
    Location
    ...
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Another Syntax Error

    Quote Originally Posted by bebo021999 View Post
    Try to use a helper cell :e.g B100=TEXT(LEFT(SUBSTITUTE(SUBSTITUTE(LEFT(J$6,FIND(" ",J$6&" ")-1),LEFT(J$6,2),""),"-",REPT(" ",10)),10),"000")&"-"&TEXT(RIGHT(SUBSTITUTE(SUBSTITUTE(LEFT(J$6,FIND(" ",J$6&" ")-1),LEFT(J$6,2),""),"-",REPT(" ",10)),10),"000")

    Then your formula will be:

    Please Login or Register  to view this content.
    I think your using of "Text" function returns different results. But I tried your (post #2) formula on an unprotected sheet and that returned accurate results

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1