Incorrect Mathematical Expression

Hello all,

Recently, we upgraded a client from 4.5 S/I to 2015.

I noticed an issue with several of the formulas and narrowed it down to the GLlink argument.

The below produces an "Incorrect Mathematical Expression" error:

GLActual("50000-100 to 50499-100, 50600-100 to 57499-100, 57510-100, 58000-100 to 59999-100",$B$4,$D$4)

However, if the GLlink argument only specifies accounts where there is a single range, it works:

GLActual( "50000-100 to 50499-100",$B$4,$D$4)

GLActual( "50600-100 to 57499-100",$B$4,$D$4)

GLActual(57510-100,$B$4,$D$4)

GLActual( "58000-100 to 59999-100",$B$4,$D$4)

The client can't seem to combine the different ranges in one long string, they can only do them separately.

Is there a way to fix this?  I'm trying to avoid having to write some VBA to convert these formulas to a working version.

Note:  Ideally I would've preferred that the client use column A:A to indicate the GL accounts and simply reference it in the formula.  Unfortunately, since this report was created "pre-me" I was unable to provide that type of direction. 

Parents
  • 0

    Unfortunately this isn't going to work.   I run the risk of replacing all the commas in all the formulas.   I have to consider the fact that the user may have nested formulas, which means that simply running the search & replace again for just those two arguments wouldn't be the end of it.   I'd have to keep scanning for new errors as a result of replacing commas in other parts of all the formulas.   This would also replace commas in standard excel formulas as well.

    Thanks for suggesting that addin but without specifying the argument location in the replace, it could potentially do more harm than good.

    I've already started writing a two part macro to resolve this:

    1.   Locate all GL formulas with errors and copy them on to a new sheet.

    2.   After manually modifying all the formulas to reflect the new operator (in the new sheet), run another macro which replaces the GL formulas with the new structure.

    FYI, Excel already has the capability of looking in Formulas as oppose to Values and replacing the characters appropriately.   It also has the ability to do this for an entire workbook as oppose to just one sheet.   The only added capabilities that the addin seems to provide is the ability to search multiple workbooks and selectively change whichever cells the user wishes to modify.

Reply
  • 0

    Unfortunately this isn't going to work.   I run the risk of replacing all the commas in all the formulas.   I have to consider the fact that the user may have nested formulas, which means that simply running the search & replace again for just those two arguments wouldn't be the end of it.   I'd have to keep scanning for new errors as a result of replacing commas in other parts of all the formulas.   This would also replace commas in standard excel formulas as well.

    Thanks for suggesting that addin but without specifying the argument location in the replace, it could potentially do more harm than good.

    I've already started writing a two part macro to resolve this:

    1.   Locate all GL formulas with errors and copy them on to a new sheet.

    2.   After manually modifying all the formulas to reflect the new operator (in the new sheet), run another macro which replaces the GL formulas with the new structure.

    FYI, Excel already has the capability of looking in Formulas as oppose to Values and replacing the characters appropriately.   It also has the ability to do this for an entire workbook as oppose to just one sheet.   The only added capabilities that the addin seems to provide is the ability to search multiple workbooks and selectively change whichever cells the user wishes to modify.

Children
No Data