+ Reply to Thread
Results 1 to 18 of 18

Formula Too Long Problem

  1. #1
    Registered User
    Join Date
    07-22-2019
    Location
    United States
    MS-Off Ver
    2010
    Posts
    15

    Formula Too Long Problem

    Hello fellow members. I am having a problem with a formula too long issue that I am hoping you
    can help me with. I have a table of parts and within that table there can be 10 different models
    and it can be sold in 20 different markets.

    This table structure is used extensively throughout the workbook, so I am hoping I don't have to
    change it in order to accomplish what I need to, which is to sum the total # of parts sold by month
    for each model & each market the part is sold. Not every model may use the part and so the
    user would just enter a zero for the quantity in the table under that model.

    The part cost may be higher or lower than the base cost in each of the 20 markets sold and so the
    user can enter a % increase/decrease for each of the 20 markets. However, not every market will
    sell the part & so my thought was to have the user enter a 0% in the market increase % to indicate
    this.

    The problem is that when I multiply the quantity used by each of the ten models for each of the
    20 markets (if the % of the market is zero) I get the error the formula is too long. I have tried to
    come up with a different methodolgy, but so far have not been able to come up with anything &
    still accomplish what I need to without changing the base structure of the table.

    I have attached an Excel workbook as an example. The formula that is highlighted in the Parts
    Sold Table shows the formula for just two models and two markets. If this formula is expanded to
    include the ten models & 20 markets I need Excel indicates it's too long.

    I look forward to any assistance you can provide me.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Formula Too Long Problem

    Maybe.

    Please Login or Register  to view this content.
    Follow with Ctrl-Shift-Enter for Array formula.

    Regards.

  3. #3
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,706

    Re: Formula Too Long Problem

    without changing your existing file {per request} the attached should work, and is non-volatile

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    if you wanted to apply the % (to quantity) simply remove the SIGN wrapper

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Formula Too Long Problem

    ARRAY formula in C3 copied to full range. It covers all 10 modules.
    Please Login or Register  to view this content.
    To enter ARRAY formula
    Copy and paste the formula in cell
    Press F2
    Press Ctrl+Shift+Enter together
    Excel covers the formula with {}.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Formula Too Long Problem

    ARRAY formula replaced .
    Normal formula in C3 then copied.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: Formula Too Long Problem

    Please try at C3

    =SUM(MMULT(TRANSPOSE(--'Units Sold by Model & Market'!C$3:C$211),--(INT((ROW($A$3:$A$211)-ROW($A$3))/21)=COLUMN($A$1:$J$1)-1))*'Parts Table'!$D3:$M3)

    Ctrl+Shift+Enter

    or

    =MMULT('Parts Table'!$D3:$M3,MMULT(--(INT((COLUMN($A$1:$HA$1)-1)/21)=ROW($A$1:$A$10)-1),--'Units Sold by Model & Market'!C$3:C$211))

    normal enter
    Attached Files Attached Files
    Last edited by Bo_Ry; 09-13-2021 at 07:03 AM.

  7. #7
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Formula Too Long Problem

    I was thinking for all night for somthing is missing in the file.
    Then I found that in 'Units Sold by Model & Market' was not mentioned about product, it just said about model.
    Is it possible for you to update more data in that sheet? Or the data are ok already?

    Regards.

  8. #8
    Registered User
    Join Date
    07-22-2019
    Location
    United States
    MS-Off Ver
    2010
    Posts
    15

    Re: Formula Too Long Problem

    Thank you for your reply. The data in the "Units Sold by Model & Market" was provided as an
    example & I was thinking that it would be sufficient to provide the concept of what I was trying
    to accomplish. The only additional data that would really need to be added is more values for
    each of the months across the columns and the # of units sold in models 3 through 10. But, that
    would merely be an expansion of the data & the resulting formula in cell C3 in the Parts Sold
    worksheet would be too large.

  9. #9
    Registered User
    Join Date
    07-22-2019
    Location
    United States
    MS-Off Ver
    2010
    Posts
    15

    Re: Formula Too Long Problem

    I would like to thank everyone for the replies. One of the aspects of the formula in cell C3 in
    the Parts Sold Table worksheet is my usage of the "Indirect" function. The reason I use this
    is because the "Parts Table" in my real model (vs. the example I provided) can expand and
    contract if the user adds or deletes parts & thus the row number for a particular part could
    change. Thus, I think I am going to need to keep this aspect of the formula. Could the
    recommended formulas be restructured to include the usage of the "Indirect" function?

  10. #10
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Formula Too Long Problem

    Someone was told me to avoid INDIRECT function, can't remember why.

    Regards.

  11. #11
    Registered User
    Join Date
    07-22-2019
    Location
    United States
    MS-Off Ver
    2010
    Posts
    15

    Re: Formula Too Long Problem

    Quote Originally Posted by Bo_Ry View Post
    Please try at C3

    =SUM(MMULT(TRANSPOSE(--'Units Sold by Model & Market'!C$3:C$211),--(INT((ROW($A$3:$A$211)-ROW($A$3))/21)=COLUMN($A$1:$J$1)-1))*'Parts Table'!$D3:$M3)

    Ctrl+Shift+Enter

    or

    =MMULT('Parts Table'!$D3:$M3,MMULT(--(INT((COLUMN($A$1:$HA$1)-1)/21)=ROW($A$1:$A$10)-1),--'Units Sold by Model & Market'!C$3:C$211))

    normal enter
    Bo_Ry, thank you for this formula. I need to only count those markets where the part is used. Thus, if the user
    enters a zero in the "Increase %" for a specific market then I don't want to count the sales in that market. I
    think this formula is counting all of the sales irrespective of having a zero in the "Increase %". If I enter your
    formula it provides me the same answer that my example did. However, if I place a zero into the "Increase %"
    for market 1, the value counted in cell C3 of the Parts Sold Table does not change. Can you please confirm.
    Thank you.

  12. #12
    Registered User
    Join Date
    07-22-2019
    Location
    United States
    MS-Off Ver
    2010
    Posts
    15

    Re: Formula Too Long Problem

    Quote Originally Posted by kvsrinivasamurthy View Post
    ARRAY formula replaced .
    Normal formula in C3 then copied.
    Please Login or Register  to view this content.
    Thank you for this formula. The resulting value equals the total sold, but it does not seem
    to not count a market if the "Increase %" in that market in the Parts Table is zero, which
    means to not count the number sold for that market from the Units Sold by Model & Market.
    Can you please confirm. Thank you.

  13. #13
    Registered User
    Join Date
    07-22-2019
    Location
    United States
    MS-Off Ver
    2010
    Posts
    15

    Re: Formula Too Long Problem

    Quote Originally Posted by XLent View Post
    without changing your existing file {per request} the attached should work, and is non-volatile

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    if you wanted to apply the % (to quantity) simply remove the SIGN wrapper

    This formula worked great until I tried to use the Indirect function for the value 'Parts Table'!$D3
    when multiplying by 'Units Sold by Model & Market'!$C3:$C22. Excel was trying to interpret the
    value as an array when using the Indirect function vs. the specific value in cell $D3 in the Parts
    Table worksheet. Everything until that point was working great.

  14. #14
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Formula Too Long Problem

    Ref: Post#12.
    In the sample file the expected result was the same as obtained from Formula.
    Can you explain with example in a sample file what is expected.

  15. #15
    Registered User
    Join Date
    07-22-2019
    Location
    United States
    MS-Off Ver
    2010
    Posts
    15

    Re: Formula Too Long Problem

    Quote Originally Posted by menem View Post
    Maybe.

    Please Login or Register  to view this content.
    Follow with Ctrl-Shift-Enter for Array formula.

    Regards.

    Thank you for this formula. This works except for one aspect that I am hoping you can
    help me with. As I noted previously, I need to use the "Indirect" function in Excel to
    reference the row as the row can change if the user deletes or adds parts to the "Parts
    Table" worksheet. So, I need to use the Indirect function when using the Transpose function
    in your formula, but Excel provides me an error when I try to enter the following:

    (TRANSPOSE(INDIRECT("'Parts Table'!"&"$N"&ROW()):INDIRECT("'Parts Table'!"&"$AG"&ROW()))>0))

    I have researched & researched for solutions & have tried various methods, but nothing works.
    Can anyone provide me a solution? Thank you!
    Last edited by Gallegos; 09-15-2021 at 11:17 PM.

  16. #16
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Formula Too Long Problem

    Pl see file
    In C3
    Please Login or Register  to view this content.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    07-22-2019
    Location
    United States
    MS-Off Ver
    2010
    Posts
    15

    Re: Formula Too Long Problem

    Quote Originally Posted by kvsrinivasamurthy View Post
    Pl see file
    In C3
    Please Login or Register  to view this content.

    Thank you for this revised formula. I sincerely appreciate all your hard work & dedication to
    helping me. Unfortunately, I tried to see if it would work but I could not get it to work because
    the formula is specifically referencing cells or a range of cells in the Parts Table worksheet.
    As I had noted previously, the parts in this worksheet can change and so the number of rows
    in the worksheet can change (could be more or less). So, I don't think specifically referencing
    the row numbers in this worksheet will work. For instance, your formula has the following
    Match function: MATCH($B3,'Parts Table'!$B$3:$B$10,0). The assumption made in this Match
    function is that the maximum # of rows is 10, but it could be 5 or 50 or 1000. In the real
    spreadsheet I do have a table defined in the Parts Table that would include the category,
    description and base cost and so this table expands and contracts as the data does. So,
    perhaps the Match function can be replaced with a table lookup? I have attached a revised
    spreadsheet showing this "Parts_Core_Data" table like it is in the real spreadsheet (vs. the
    example). Also, because the rows can change in the Parts Table, I believe your Index function
    would need to change as well. You currently have INDEX('Parts Table'!$D$3:$M$10, but that would
    need to be changed to INDEX(INDIRECT("'Parts Table'!"&"$D"&ROW()):INDIRECT("'Parts Table'!"&"$M"&ROW())
    to allow the flexibility if the row changing.
    Last edited by Gallegos; 09-16-2021 at 11:56 PM.

  18. #18
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Formula Too Long Problem

    The problem referred is solved . Here is the required formula in C3. It takes care up to 1000 rows. Index and match combination looks for selection of range properly.
    If you want to change the number of rows Using Ctrl+F change 1000 to required number of rows.
    Please Login or Register  to view this content.
    I avoided INDIRECT formula. It is a passive formula and slows down the working of Excel. Vlookup formula can select only single value. Here arange of cells are to be selected. So INDEX and MATCH is used.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 09-17-2021 at 01:03 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Substitute formula lower and upper case character and long text problem
    By silambarasan.J in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-08-2016, 09:41 AM
  2. Problem with recording a macro with long formula - works in Excel but not in macro
    By tonybeo2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-28-2015, 11:25 AM
  3. Long Array Formula Problem
    By tnederlof in forum Excel General
    Replies: 12
    Last Post: 08-20-2009, 02:55 PM
  4. Problem with a long formula
    By sa02000 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-04-2008, 11:59 AM
  5. Formula too long problem.
    By zipp in forum Excel General
    Replies: 4
    Last Post: 06-15-2007, 06:32 PM
  6. [SOLVED] Formula too long problem
    By rfritz in forum Excel General
    Replies: 2
    Last Post: 06-09-2006, 01:20 PM
  7. Problem with VBA returning the contents of a long formula.
    By alfred.vachris@gmail.com in forum Excel General
    Replies: 2
    Last Post: 02-22-2005, 09:06 PM

Tags for this Thread

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