+ Reply to Thread
Results 1 to 5 of 5

Array or Vector? sum the max of two cells in a row, when row meets certain criteria

  1. #1
    Registered User
    Join Date
    02-23-2015
    Location
    texas
    MS-Off Ver
    MAC OSX
    Posts
    30

    Array or Vector? sum the max of two cells in a row, when row meets certain criteria

    Screen Shot 2015-02-23 at 12.52.27 PM.png

    Goal:

    In each row that has Column 3 be "B753", column 7 = "no", and column 9 blank (""), I need to take the higher of column 4 or 5 (shown in bold, with the lesser in strikethrough) and sum them all.

    In the example here the sought answer is 2:58 + 5:34.

    I have about 100 row to look through.

    I don't think this can be done in a vector, but rather an array.

    Anyone?

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Array or Vector? sum the max of two cells in a row, when row meets certain criteria

    Assuming your first column is column A you can use an "array formula like this:

    =SUM(IF(C2:C100="B753", IF(G2:G100="No",IF(I2:I100="",IF(D2:D100>E2:E100,D2:D100,E2:E100)))))

    confirmed with CTRL+SHIFT+ENTER
    Audere est facere

  3. #3
    Registered User
    Join Date
    02-23-2015
    Location
    texas
    MS-Off Ver
    MAC OSX
    Posts
    30

    Re: Array or Vector? sum the max of two cells in a row, when row meets certain criteria

    Thanks for the get-back.

    That was fast, and elegant. Thanks. My weakness with arrays is recency of use, which leads to confusion when formatting the strings. I was stumbling going down an "if(and(" route rather than nesting just the "if's".

    Thanks again.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Array or Vector? sum the max of two cells in a row, when row meets certain criteria

    Yes, you can't use AND because it returns a single result rather than an array - I think nested IFs is possibly marginally more efficient but the other way is to use * to join conditions, simulating an "AND"

  5. #5
    Registered User
    Join Date
    02-23-2015
    Location
    texas
    MS-Off Ver
    MAC OSX
    Posts
    30

    Re: Array or Vector? sum the max of two cells in a row, when row meets certain criteria

    I like the nested IFs. I have about 8 or 10 different conditions to which this has to apply. Just dragging up and down, replacing the key variables to make it all work.

+ 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: 4
    Last Post: 12-21-2012, 02:56 PM
  2. Returning Data from an array only if it meets certain criteria
    By Jantzev in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-02-2008, 07:57 PM
  3. [SOLVED] Array to read data from one sheet and write to another if it meets criteria
    By RudyShoe in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2006, 11:40 AM
  4. [SOLVED] In an array, I need to find the row # that meets 2 criteria
    By Space Elf in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-08-2006, 12:00 PM
  5. If a cell meets criteria, sum cells on that row
    By add1023 in forum Excel General
    Replies: 1
    Last Post: 03-16-2005, 11:40 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