+ Reply to Thread
Results 1 to 11 of 11

How do I write these formulas more efficiently?

  1. #1
    Registered User
    Join Date
    02-28-2018
    Location
    Minnesota, USA
    MS-Off Ver
    14.7.1
    Posts
    5

    How do I write these formulas more efficiently?

    I would like to know how to type the following formula set in a more efficient way:


    =MIN(SUMXMY2(a1:c1,e1:g1),SUMXMY2(a1:c1,e2:g2),SUMXMY2(a1:c1,e3:g3),...,(SUMXMY2(a1:c1,e5000:g5000))
    =MIN(SUMXMY2(a2:c2,e1:g1),SUMXMY2(a2:c2,e2:g2),SUMXMY2(a2:c2,e3:g3),...,(SUMXMY2(a2:c2,e5000:g5000))
    ...
    =MIN(SUMXMY2(a5000:c5000,e1:g1),SUMXMY2(a5000:c5000,e2:g2),SUMXMY2(a5000:c5000,e3:g3),...,(SUMXMY2(a5000:c5000,e5000:g5000))


    Is there a way to do that?
    Last edited by relknes; 02-28-2018 at 10:05 AM. Reason: Fixing title and refining question

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: formula help

    Maybe....

    H1, copied down:
    =MIN(SUMXMY2($A$1:$C$1,E1:G1))

    I1 =MIN(H:H)
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: Lá fhéile Pádraig sona dhaoibh

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: formula help

    I've just noticed that your thread title is meaningless. Please re-read rule 1, that you just agreed to adhere to, and then select "thread tools" from the top of post 1 and change it to something that you would use if you were using Google to search for a solution....

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,987

    Re: formula help

    Welcome to the forum! Please take a moment to re-read forum rule #1 and then amend your thread title to something that better explains your problem. Changing your thread title is not optional, which means you must change it. Thanks!

    • Use concise, accurate thread titles.
    • Your post title should describe your problem, not your anticipated solution.
    • Use terms appropriate to a Google search - poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice tell us nothing.
    • Responding to a request to change your thread title by doing so is mandatory.

    To change a title go to your first post, click EDIT then Go Advanced and change your title.

    No help to be offered, please, until the OP complies with this request.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    02-28-2018
    Location
    Minnesota, USA
    MS-Off Ver
    14.7.1
    Posts
    5

    Re: How do I write these formulas more efficiently?

    The original post has been edited to refine the title.
    Sorry about that. No offense was intended. I will try to keep titles specific in the future.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,987

    Re: How do I write these formulas more efficiently?

    No offence taken! However, I recommend you read the forum rules you agreed to on joining today: https://www.excelforum.com/forum-rul...rum-rules.html

    Thanks for changing your title.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: How do I write these formulas more efficiently?

    So, relknes.... was my suggestion of any use to you?

  8. #8
    Registered User
    Join Date
    02-28-2018
    Location
    Minnesota, USA
    MS-Off Ver
    14.7.1
    Posts
    5
    Quote Originally Posted by Glenn Kennedy View Post
    So, relknes.... was my suggestion of any use to you?
    I am looking for a way to do it in a single cell. I keep feeling like I need to use an array, but I'm not familiar enough with array functions to know how to do it.

  9. #9
    Registered User
    Join Date
    02-28-2018
    Location
    Minnesota, USA
    MS-Off Ver
    14.7.1
    Posts
    5

    Re: How do I write these formulas more efficiently?

    Single cell per MIN function, that is, so 5000 cells in the example rather than 5000^2.

  10. #10
    Registered User
    Join Date
    02-28-2018
    Location
    Minnesota, USA
    MS-Off Ver
    14.7.1
    Posts
    5

    Re: How do I write these formulas more efficiently?

    So I ended up trying to solve this by writing a Macro. This is my first attempt at writing code in VBA. I basically used the record function to get one step of Glenn Kennedy's idea, and then coded in some iterations, ending up with:

    Please Login or Register  to view this content.
    I would say that this solved the issue, but it is running really slow (as in, running the full script takes hours/crashes my computer, so I have to run it in batches manually), and I want to make sure that this is just a function of the number of calculations rather than some problem in my code.
    Thanks, Glenn Kennedy, for pointing the way on how to execute these loops.

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: How do I write these formulas more efficiently?

    I did try to adapt some alternative formulae, but got nowhere and gave up as I reckoned that no single formula solution would ever be fast enough.

    Personally, I'd stick with the helper....

    Anyhow... glad you were able to get something.You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. Replies: 5
    Last Post: 02-16-2018, 06:50 AM
  2. Replies: 8
    Last Post: 09-22-2017, 05:41 AM
  3. Excel formula bar to display the result of the formula , not the formula?
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2016, 07:15 PM
  4. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  5. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 PM

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