+ Reply to Thread
Results 1 to 4 of 4

Optimizing after the sum of individual cells in 4 columns if it’s less than selected cells

  1. #1
    Registered User
    Join Date
    11-08-2018
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    2

    Question Optimizing after the sum of individual cells in 4 columns if it’s less than selected cells

    This is mu function so far:
    =max(if(C1:C4<=A1,D1:D4,))
    Explanation: look for the maximum value Within the array D1 to D4 if any of the values in C1 to C4 are equal to or less than the value in A1.

    Examples:
    When C1<=A1 then print D1.
    When C2<=A1 then print D2.
    When C3<=A1 then print D3.

    The problem is when I want to look if two columns are <= A1.
    =max(if(C1:C4+F1:F4<=A1,D1:D4+G1:G4,))
    It will check if C1+F1<=A1, C2+F2<=A1, C3+F3<=A1, C4+F4<=A1. And print for example D1+G1, D2+G2 etc

    I want this formula to check if any of the cells in column C plus any of the cells in column F are <=A1, so for example C1+F3 print D1+G3.

    What function do I need to look if any of the values in column C plus any of the values in column F is equal to or less than the value in A1?
    And if that is true, how do I print the cells next to the chosen cells?

    And how do I add more after that?
    Example:C1:C4+F1:F4+I1+I4+L1:L4 if true print D1:D4+G1:G4+J1:J4+M1:M4

    Basically this is maximizing columns D+G+J+M when columns C+F+I+L is less than cell A1.

    One last thing is that I need this to be a formula, because other formula are connected to these cells and numbers.

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2502
    Posts
    13,700

    Re: Optimizing after the sum of individual cells in 4 columns if it’s less than selected c

    Hi maredream. Welcome to the forum.

    If I understand correctly please see if this does what you intend.

    This formula in I2 and filled down returns the sums of C1+F1, C1+F2, C1+F3, C1+F4 and then C2+F1, C2+F2 ... etc.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then in J1 and filled down conditional upon the results of the first formula being <= A1 D1+G1, .... etc same as the first formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    ....
    And if that is true, how do I print the cells next to the chosen cells?
    I am not sure I know what you mean by this. I took a guess and in K1 and down this groups the results of column J.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by FlameRetired; 11-09-2018 at 12:51 AM.
    Dave

  3. #3
    Registered User
    Join Date
    11-08-2018
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Optimizing after the sum of individual cells in 4 columns if it’s less than selected c

    Thank you for the reply.
    This method will not work since i have 4 columns with 80+ rows in them.
    i need a function or a formula that looks at individual cells in the four columns and then sums these cells together IF they are meeting my restriction which is: equal to or less than the value in cell A1.

    i used the function =max(if("array1"+"array2"+"array3"+"array4"<=A1;"array11"+"+array21"+"array31"+"array41") then Ctrl + Shift + Enter but that gives me the wrong value. it checks the if the first row of numbers in each column are compatible with A1, if not, it checks the second row of numbers in each column.... etc, and i want it to check for the individual cells, not rows.

    im gonna edit the thread to include a excel file so that you can have a look what in detail. it's in swedish excel, so i think you will have to edit the =max(om to =max(if(, and also we use ; instead of , in the swedish version.

    do not know how to include a link... if anyone could explain how to do that i would appreciate it
    Last edited by maredream; 11-14-2018 at 07:55 PM.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2502
    Posts
    13,700

    Re: Optimizing after the sum of individual cells in 4 columns if it’s less than selected c

    If you upload the sample Excel file directly to the forum you won't need a link and I believe each of our local settings will "translate" and replace ";" with "," where appropriate.

    The 'paperclip' icon has not worked for a long time. So:
    To attach a file to your post: (Please no pics or screenshots ... saves retyping data.),

    be sure to desensitize the data
    • click “Go Advanced” (next to Post Quick Reply – bottom right),
    • scroll down until you see “Manage Attachments”, click that,
    • click “Browse”.
    • select your file(s)
    • click “Upload”
    • click “Close window”
    • click “Submit Reply”
    The file name will appear at the bottom of your reply.

    Also please upload to your next post and not by editing your first one. It preserves the flow of the "conversation" for those who join us late.
    Last edited by FlameRetired; 11-14-2018 at 08:57 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. [SOLVED] Count Columns of selected cells
    By kamaflage in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-22-2016, 02:58 PM
  2. separate a data string at each comma into individual cells/columns
    By syncguy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-03-2016, 07:37 AM
  3. [SOLVED] Change how selected cells are shown in columns
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2013, 07:48 AM
  4. Outputting individual cells to individual text files
    By db9429 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-17-2013, 03:39 PM
  5. Shifting Cells then Optimizing
    By rybuns in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2010, 05:09 PM
  6. Replies: 2
    Last Post: 10-20-2008, 12:53 AM
  7. Optimizing memory, speed: Arrays vs. Cells, etc...
    By T_o_n_y in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-02-2006, 04:15 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