+ Reply to Thread
Results 1 to 19 of 19

Can you shorten a LONG formula?

  1. #1
    Registered User
    Join Date
    02-19-2020
    Location
    SE-Asia
    MS-Off Ver
    2019
    Posts
    98

    Can you shorten a LONG formula?

    This is a part of a (LONG) Function

    Please Login or Register  to view this content.
    Is there way to Shorten this?

    This Function (formula) is then copied all the way down

    TiA

    Ps: Please a hint first instead of the "pre-cooked" solution
    Last edited by iammike; 04-15-2024 at 09:37 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: Can you shorten a LONG formula?

    Hint: take a look a the SUM function. The 2's can be factored out....
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    02-19-2020
    Location
    SE-Asia
    MS-Off Ver
    2019
    Posts
    98

    Re: Can you shorten a LONG formula?

    Thx!

    Would that be in a Array Formula?

    Edit: I do believe it's not, as there is NO criteria. Or is there?
    Last edited by iammike; 04-15-2024 at 10:01 PM.

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: Can you shorten a LONG formula?

    No it's not.

  5. #5
    Registered User
    Join Date
    02-19-2020
    Location
    SE-Asia
    MS-Off Ver
    2019
    Posts
    98

    Re: Can you shorten a LONG formula?

    Oke breaking it down

    I can do a sum of the ranges

    1) L8+M8+N8+O8+P8 - (L8:P8)
    2) do 2*(Q8:S8)

    But then I am still stuck with
    +H8
    and (2*I8)

    Would it then be that much shorter?

    This is what I got thus far

    Please Login or Register  to view this content.
    Edit:

    I think I got it

    Please Login or Register  to view this content.
    Last edited by iammike; 04-15-2024 at 10:26 PM.

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: Can you shorten a LONG formula?

    Combine SUM(Q8:S8)*2+(2*I8) into one SUM. SUM arguments can be combinations of single cells and ranges separated by commas.

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,831

    Re: Can you shorten a LONG formula?

    I could see turning that into a single SUMPRODUCT() function. (as a hint, let me know when you want to see how I might put it together).
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  8. #8
    Registered User
    Join Date
    02-19-2020
    Location
    SE-Asia
    MS-Off Ver
    2019
    Posts
    98

    Re: Can you shorten a LONG formula?

    @protonleah.

    Thx, If you see my edit in my previous post, I think I did just that

    Please Login or Register  to view this content.
    @MrShorty

    Not yet, I want to try it myself, I learn way more by trying it myself at first.
    Last edited by iammike; 04-16-2024 at 12:47 AM.

  9. #9
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Can you shorten a LONG formula?

    Try
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  10. #10
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,740

    Re: Can you shorten a LONG formula?

    Quote Originally Posted by iammike View Post
    ... I think I did just that ...
    You can get rid of some of your brackets (in pairs)

    Pete

  11. #11
    Registered User
    Join Date
    02-19-2020
    Location
    SE-Asia
    MS-Off Ver
    2019
    Posts
    98

    Re: Can you shorten a LONG formula?

    @Pete_UK,

    I have honesty NO idea how to shorten that even further (Oke can remove some brackets )

    I have been trying with SUMPRODUCT, but not much luck.

    @avk

    Is the Solution

    Please Login or Register  to view this content.
    (with some brackets removed )

    Not better, because I combine
    Please Login or Register  to view this content.
    in there as
    Please Login or Register  to view this content.
    Last edited by iammike; 04-16-2024 at 05:00 AM.

  12. #12
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,740

    Re: Can you shorten a LONG formula?

    Is this any shorter?

    =SUM(H8:I8;L8:S8;I8;Q8:S8)

    Only one function call, as well.

    If J8 and K8 are both numbers, you could do this:

    =SUM(H8:S8;I8;Q8:S8)-J8-K8

    Hope this helps.

    Pete

  13. #13
    Registered User
    Join Date
    02-19-2020
    Location
    SE-Asia
    MS-Off Ver
    2019
    Posts
    98

    Re: Can you shorten a LONG formula?

    =SUM(H8:I8;L8:S8;I8;Q8:S8)

    Works great. Brilliant this, very clever to add for example I8 again (never thought of that but it's totally logical)

  14. #14
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,740

    Re: Can you shorten a LONG formula?

    Glad to help, and thanks for the rep.

    Pete

  15. #15
    Registered User
    Join Date
    02-19-2020
    Location
    SE-Asia
    MS-Off Ver
    2019
    Posts
    98

    Re: Can you shorten a LONG formula?

    @Pete_UK

    But may I say, I find

    =SUM(H8;L8:P8)+(SUM(I8;Q8:S8)*2)

    Easier to read (but that is because I am not that experienced yet

  16. #16
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,740

    Re: Can you shorten a LONG formula?

    Yeah, that's fine, but you don't need the brackets around the second SUM function:

    =SUM(H8;L8:P8)+SUM(I8;Q8:S8)*2

    Hope this helps.

    Pete

  17. #17
    Registered User
    Join Date
    02-19-2020
    Location
    SE-Asia
    MS-Off Ver
    2019
    Posts
    98

    Re: Can you shorten a LONG formula?

    Hope this helps.
    It most certainly does

  18. #18
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,831

    Re: Can you shorten a LONG formula?

    I have been trying with SUMPRODUCT, but not much luck.
    I was thinking of something like
    =SUMPRODUCT(H8:S8,{1,2,0,0,1,1,1,1,1,2,2,2}) or
    =SUMPRODUCT(H8:S8,H$7:S$7) where H7:S7 contains the array of multipliers.
    I usually prefer the latter version with the helper cells, because then it is easier to edit the array of multipliers, if that is ever necessary.

  19. #19
    Registered User
    Join Date
    02-19-2020
    Location
    SE-Asia
    MS-Off Ver
    2019
    Posts
    98

    Re: Can you shorten a LONG formula?

    Here the WB where the Formula is used.

    It's for our upcoming Camper Trip, I want to exactly know if the prices the Camper Pitches charge us are correct.
    Attached Files Attached Files
    Last edited by iammike; 04-16-2024 at 10:26 PM.

+ 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. Shorten Long Formula
    By fastcar in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-20-2020, 02:41 PM
  2. shorten very long formula
    By dioxide in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-22-2019, 06:58 PM
  3. How to use AND & IF and shorten a long formula
    By VisionSmart in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-16-2019, 06:45 AM
  4. [SOLVED] How to shorten Too Long Countif formula
    By putraguevara in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 01-10-2019, 04:12 PM
  5. Long formula, need to shorten
    By BlairStevenson in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-06-2014, 12:23 PM
  6. [SOLVED] Too Long formula to shorten help
    By lapot in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-14-2014, 07:51 AM
  7. [SOLVED] Shorten a very long Formula
    By Floydlevedale in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-15-2013, 09:39 AM

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