+ Reply to Thread
Results 1 to 8 of 8

Add Multiple Values Based on Criteria

  1. #1
    Registered User
    Join Date
    07-16-2014
    Location
    UK
    MS-Off Ver
    2016
    Posts
    90

    Red face Add Multiple Values Based on Criteria

    Add Multiple Values Based on Criteria

    Search for the word "Clear" in the Task column.
    If the word "Clear" is found, go to Value column.
    Add all values starting from "Clear" down to the end of the list.
    If it is larger than 10, return the word "OK". Otherwise "Poor".
    If larger than 20, return the word "Good".
    The length of the list is variable.

    Here is the sample worksheet (Please click).

    How should I do?
    Thanks a lot.
    Last edited by mastertonn; 07-24-2014 at 02:28 AM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Add Multiple Values Based on Criteria

    what if
    1 no match for clear
    2 if sum larger than 20
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Add Multiple Values Based on Criteria

    one way
    =IFERROR(LOOKUP(SUM(INDEX(B:B,MATCH("clear",A:A,0)):INDEX(B:B,MATCH(10^99,B:B,1))),{0,10.000001,20},{"poor","ok","good"}),"clear not found")
    if its whole numbers only
    =IFERROR(LOOKUP(SUM(INDEX(B:B,MATCH("clear",A:A,0)):INDEX(B:B,MATCH(10^99,B:B,1))),{0,11,20},{"poor","ok","good"}),"clear not found")
    or you could roundup the sum

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Add Multiple Values Based on Criteria

    I understand that you want the total for all the values in all the value columns that match CLEAR in the Task columns.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Registered User
    Join Date
    07-16-2014
    Location
    UK
    MS-Off Ver
    2016
    Posts
    90

    Re: Add Multiple Values Based on Criteria

    Quote Originally Posted by martindwilson View Post
    what if
    1 no match for clear
    2 if sum larger than 20
    1. Just return "no match".
    2. Sorry, I meant to say larger than 20.

  6. #6
    Registered User
    Join Date
    07-16-2014
    Location
    UK
    MS-Off Ver
    2016
    Posts
    90

    Re: Add Multiple Values Based on Criteria

    Quote Originally Posted by newdoverman View Post
    I understand that you want the total for all the values in all the value columns that match CLEAR in the Task columns.
    Sorry that I was not clear.
    Not all of them. Each table is treated separately.

    Also there will be other data in the actual worksheet.
    It would be the best it can detect the end of the list intellectually so I can apply the same formula to all tables universally.
    Last edited by mastertonn; 07-16-2014 at 10:18 PM.

  7. #7
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Thumbs up Re: Add Multiple Values Based on Criteria

    Try this out..
    I have used array formula..
    so use ctrl shift enter to enter the formula...




    Don't forget to click *
    Attached Files Attached Files

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Add Multiple Values Based on Criteria

    ok a modification
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    since larger than 10 can be 10.1
    this formula rounds up anything with a decimal to the next integer
    so 10 stays 10 10.0001 rounds up to 11

+ 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: 05-19-2015, 11:53 PM
  2. [SOLVED] How to return multiple values to a single cell based on multiple criteria
    By lwallace in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-20-2014, 06:32 AM
  3. [SOLVED] Lookup and sum multiple values based on a single criteria in multiple sheets.
    By paulsanett in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2014, 12:18 PM
  4. [SOLVED] How to sum values based on multiple criteria with multple possibilities for each criteria?
    By boredaxel in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-05-2013, 02:26 AM
  5. Aggregate multiple values into one cell based on multiple criteria using VBA
    By jwestover1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-04-2013, 01:17 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