+ Reply to Thread
Results 1 to 11 of 11

MIN + SUM problem

  1. #1
    Registered User
    Join Date
    08-09-2016
    Location
    Switzerland
    MS-Off Ver
    2007
    Posts
    3

    Post MIN + SUM problem

    Hello everyone, I think this is a tough one:

    data1 data2 data3 easy way good way
    34 67 89 190
    34 34 67 135
    23 4 5 32
    76 34 45 155
    answer: 32 ???

    let me walk you through this:
    I have three data columns, and I'm looking for a function that returns the line on which the sum of the three datas is the smallest. The easy way is to create an additionnal column, but I'm looking to do that in a single cell (for philosophical reasons which I'm sure you all agree with)

    help?

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: MIN + SUM problem

    Hi, welcome to the forum,
    You could place a formula in one specific cell that calculates the MAX(range) or the MIN(range)
    Last edited by Keebellah; 08-09-2016 at 04:58 AM. Reason: say hello
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    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,830

    Re: MIN + SUM problem

    I think the OP wants to try to do this without a helper column: he (she) wants to have the formula work out the sum of each of the rows separately and then decide which outcome is the minimum. I think it's going to be tricky with a formula alone. Maybe VBA?

    I would like to know what the philosophical reasons are so that I can decide whether or not I agree with them.
    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.

  4. #4
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: MIN + SUM problem

    See attached file

    I used this formula to get the minimum row match. Its an array formula so control + shift + enter to make it work

    =MATCH(MIN(A1:A4+B1:B4+C1:C4),A1:A4+B1:B4+C1:C4,0)

    Wasn't sure if you wanted the row number - 3 or the minimum - 32.

    If you just wanted the minimum then this will do it

    =MIN(A1:A4+B1:B4+C1:C4)
    Attached Files Attached Files
    Happy with my advice? Click on the * reputation button below

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: MIN + SUM problem

    but I'm looking to do that in a single cell (for philosophical reasons which I'm sure you all agree with)
    I do NOT agree.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  6. #6
    Registered User
    Join Date
    08-09-2016
    Location
    Switzerland
    MS-Off Ver
    2007
    Posts
    3

    Thumbs up Re: MIN + SUM problem

    Quote Originally Posted by Keebellah View Post
    Hi, welcome to the forum
    Thank you! I'm impressed by how fast you guys are!
    Quote Originally Posted by AliGW View Post
    I would like to know what the philosophical reasons are so that I can decide whether or not I agree with them.
    Oh, just ease of use and minimalism. It's better to know Excel more rather than using work-arounds, right? Also why would you use a helper column when there's a simpler way?

    Quote Originally Posted by Crooza View Post
    See attached file

    I used this formula to get the minimum row match. Its an array formula so control + shift + enter to make it work

    =MATCH(MIN(A1:A4+B1:B4+C1:C4),A1:A4+B1:B4+C1:C4,0)

    Wasn't sure if you wanted the row number - 3 or the minimum - 32.

    If you just wanted the minimum then this will do it

    =MIN(A1:A4+B1:B4+C1:C4)
    THANK YOU, I knew about the =MIN(A1:A4+B1:B4+C1:C4) part, but using CTRL + SHIFT + ENTER is what I didn't know, thanks again!


    Quote Originally Posted by oeldere View Post
    I do NOT agree.
    no need to be salty, just being whimsical

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: MIN + SUM problem

    Also why would you use a helper column when there's a simpler way?
    using a helpcolumn can avoid a difficult formula which is difficult to change (for the forummembers).

    so I prefer to stick with the (easy) helpcolumns.

    some members want to impress their boss with a complex formula and get stuck when it needs to be changed.

  8. #8
    Registered User
    Join Date
    08-09-2016
    Location
    Switzerland
    MS-Off Ver
    2007
    Posts
    3

    Re: MIN + SUM problem

    I get that some people will just copy + paste and not think about it twice,
    but I think it's generally better to understand how the difficult formula works to be able to change it, which then makes you better at Excel, right?

  9. #9
    Registered User
    Join Date
    06-21-2013
    Location
    Wiltshire, UK
    MS-Off Ver
    365 Version 2210 Build 16.0.15726.20070
    Posts
    72

    Re: MIN + SUM problem

    I was working an array formula also, but Crooza hit it before me. Just out of curiosity, how would you extend this to X rows of data? Sure you could add extra ranges/arrays
    Please Login or Register  to view this content.
    but what if you had 100 rows, 1000 rows, still growing? Would you need to resort to VBA or an extra column??
    Isskint, i get satisfaction out of helping others

  10. #10
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: MIN + SUM problem

    Quote Originally Posted by oeldere View Post
    using a helpcolumn can avoid a difficult formula which is difficult to change (for the forummembers).

    so I prefer to stick with the (easy) helpcolumns.

    some members want to impress their boss with a complex formula and get stuck when it needs to be changed.

    I'm with you Oeldere, I use helper columns ALL the time in my own solutions in real life but there is a growing drive I see on the forum to have a purist solution with everything calculated in one cell. As you can see its possible but trying to decode a problem months later can be a real pain so I use helpers and hide them if I don't want them to show.

  11. #11
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: MIN + SUM problem

    @crooza

    and hide them if I don't want them to show.
    Or put them in a column at the end of the data, and don't print them.

    @orangejuice

    but I think it's generally better to understand how the difficult formula works to be able to change it, which then makes you better at Excel, right?
    of course that is a good thing to do.

+ 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. [SOLVED] Excel Macro - Copy & Paste (Font) problem & Delete Last Added Rows problem
    By LennartB in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2015, 06:58 AM
  2. Replies: 1
    Last Post: 04-01-2015, 02:30 PM
  3. Replies: 6
    Last Post: 10-20-2013, 07:16 PM
  4. input box problem, cell filtering problem, result display while locking sheet
    By croozin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2013, 08:52 AM
  5. Replies: 6
    Last Post: 05-28-2013, 05:08 PM
  6. Problem Using Solver with an optimization stock problem
    By Jagrubski in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-24-2013, 03:41 AM
  7. Replies: 2
    Last Post: 01-22-2013, 07:09 AM

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