+ Reply to Thread
Results 1 to 10 of 10

Formula too long

  1. #1
    Registered User
    Join Date
    07-28-2009
    Location
    nowhere
    MS-Off Ver
    Excel 2003
    Posts
    23

    Formula too long

    I need to write a formula but excel shows an error message "Formula Too Long." There are two long strings of the formula that I repeat several times. Is there any way to put these strings in other cells and reference them within the formula? Each of the strings looks very similar to this:
    Please Login or Register  to view this content.
    When I've tried even simpler formulas with this string, I get #N/A.

    Thanks for your help.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula too long

    Are you looking to match a number in A17:A46316...because COLUMN()-4 returns a number?

    Can you elaborate by way of attached sheet what it is you are trying to do?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Formula too long

    You can certainly put your individual INDEX formulas inside other cells and reference them (unless you're working within an ARRAYED formula). If you're receiving an #NA error, perhaps there is something else askew. Can you post an example workbook?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    07-28-2009
    Location
    nowhere
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Formula too long

    Attached is a sample of what I'm working with. I'm trying to integrate linear interpolation into a formula that currently gives me the largest value that is less than or equal to a particular cell in a specified array. This formula, used in Q17:Q142 and as many columns to right as is needed given the data set, is:
    Please Login or Register  to view this content.
    What I would like (but is too long for the cell) is:

    Please Login or Register  to view this content.
    I hope I ballanced all the parentheses.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-28-2009
    Location
    nowhere
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Formula too long

    Quote Originally Posted by ChemistB View Post
    You can certainly put your individual INDEX formulas inside other cells and reference them (unless you're working within an ARRAYED formula). If you're receiving an #NA error, perhaps there is something else askew. Can you post an example workbook?
    So if I'm working with array formulas there's no way?

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula too long

    I don't think you need to use the OFFSET() function to get the range bottoms...

    you only need to -1 from the Match() functions within the Index() function for finding the Row.

    So your working formula would now be:

    Please Login or Register  to view this content.
    but I don't really understand what you are doing... so you may have to elaborate by way of spelling it out in words and showing example expected results...

    ... maybe you will have to split the formula in two cells and then combine the result by dividing one by the other (or whatever) to get the final result in the third cell....

  7. #7
    Registered User
    Join Date
    07-28-2009
    Location
    nowhere
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Formula too long

    That does save some space, but not enough. I'll give it some thought and get back to you tomorrow.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Formula too long

    It not only saves space, it should make the formula non-volatile.. ie. it won't keep recalculating everytime a non-precedent cell is changed...

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Formula too long

    I'm trying to integrate linear interpolation ...
    I can provide a UDF to do linear interpolation, but I can't tell what you're trying to interpolate from your example.
    Last edited by shg; 08-19-2009 at 12:39 AM.
    Entia non sunt multiplicanda sine necessitate

  10. #10
    Registered User
    Join Date
    07-28-2009
    Location
    nowhere
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: Formula too long

    In the attached file, column A contains the trial number, column D contains the effective x values, column K contains the effective y values and column P contains the x values for which a y value is desired. Columns B, G, H & L may be ignored. Each column to the right of P will contain a y value that corresponds to the x value in column P of the same row, given the existing (x,y) pairs in columns D and K. However, each column will consider only one trial at a time (beginning with 13) and increasing by 1 (this is the purpose of COLUMN()-4.

    The linear interpolation comes in because the values in column P do not always correspond to values in column D. I would like the computer to a linear interpolation between the (D,K) coordinates whose value in column D is the greatest number that is less than or equal to the value in column P and the next largest value in column D.

    If this is confusing, all of the arrays and references minus any interpolation can be found in the first formula of my second post yesterday. Just paste the formula in Q17 and fill to R142.

    Thanks for your help.

+ 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